{"id":1160,"date":"2014-06-16T11:59:00","date_gmt":"2014-06-16T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/06\/16\/powertip-load-powershell-modules-and-see-whats-imported\/"},"modified":"2014-06-16T11:59:00","modified_gmt":"2014-06-16T11:59:00","slug":"powertip-load-powershell-modules-and-see-whats-imported","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-load-powershell-modules-and-see-whats-imported\/","title":{"rendered":"PowerTip: Load PowerShell Modules and See What&#8217;s Imported"},"content":{"rendered":"<p><b>Summary<\/b>: Learn to parse load information about modules to see what&rsquo;s imported.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\">&nbsp;How can I analyze what is imported when a Windows PowerShell module loads?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\">&nbsp;Use the&nbsp;<b>&ndash;Verbose<\/b>&nbsp;switch when importing the module, and redirect the verbose stream to a <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text file so you can use Windows PowerShell cmdlets to parse the file. In the following example,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; all modules are loaded, verbose output is redirected to a file, and&nbsp;<b>Select-String<\/b>&nbsp;is used to parse <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the file&nbsp;(<b>gmo<\/b>&nbsp;is an alias for&nbsp;<b>Get-Module<\/b>&nbsp;and&nbsp;<b>ipmo<\/b>&nbsp;is an alias for&nbsp;<b>Import-Module<\/b>):<\/p>\n<p style=\"margin-left:120px\">gmo -l | ipmo -Verbose | 4&gt;&gt;c:fsomodload.txt<\/p>\n<p style=\"margin-left:120px\">$a = Get-Content C:fsomodload.txt<\/p>\n<p style=\"margin-left:120px\">$a | Select-String &#8220;importing&#8221;<\/p>\n<p style=\"margin-left:120px\">$a | Select-String &#8220;alias&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn to parse load information about modules to see what&rsquo;s imported. &nbsp;How can I analyze what is imported when a Windows PowerShell module loads? &nbsp;Use the&nbsp;&ndash;Verbose&nbsp;switch when importing the module, and redirect the verbose stream to a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text file so you can use Windows PowerShell cmdlets to parse the [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[356,3,45],"class_list":["post-1160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn to parse load information about modules to see what&rsquo;s imported. &nbsp;How can I analyze what is imported when a Windows PowerShell module loads? &nbsp;Use the&nbsp;&ndash;Verbose&nbsp;switch when importing the module, and redirect the verbose stream to a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text file so you can use Windows PowerShell cmdlets to parse the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=1160"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=1160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=1160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=1160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}