{"id":6594,"date":"2019-09-24T23:05:46","date_gmt":"2019-09-24T21:05:46","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=6594"},"modified":"2019-09-25T07:17:47","modified_gmt":"2019-09-25T05:17:47","slug":"powershell-import-a-module-from-a-file","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/powershell-import-a-module-from-a-file\/","title":{"rendered":"Powershell: Import a module from a file"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_6594 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_6594')){$('.twoclick_social_bookmarks_post_6594').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Powershell%3A%20Import%20a%20module%20from%20a%20file\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Ayou%20just%20want%20to%20test%20a%20module%20and%20don%27t%20want%20to%20install%20or%20copy%20it%20to%20the%20Powershell%20Modules%20directories%3F%20It%27s%20possible%20%3A-%29%0D%0A%0D%0AFor%20example%20the%20SpeculationControl%20module%20to%20query%20the%20speculation%20control%20%28Spectre%2FMeltdown%20vulnerability%29%20settings%20of%20your%20system.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/powershell-import-a-module-from-a-file\\\/\",\"post_id\":6594,\"post_title_referrer_track\":\"Powershell%3A+Import+a+module+from+a+file\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>you just want to test a module and don&#8217;t want to install or copy it to the Powershell Modules directories? It&#8217;s possible \ud83d\ude42<\/p>\n<p>For example the SpeculationControl module to query the speculation control (Spectre\/Meltdown vulnerability) settings of your system.<br \/>\n<!--more--><\/p>\n<p>Download the latest version from the <a href=\"https:\/\/www.powershellgallery.com\/packages\/SpeculationControl\" rel=\"noopener noreferrer\" target=\"_blank\">powershell gallery<\/a>.<\/p>\n<p>Got to the manual download tab and get the nuget package. The nuget package is a zip which contains the module and some metainformations (dependencies&#8230;.).<\/p>\n<p>Extract the SpeculationControl.psm1 and SpeculationControl.psd1 files to a folder, i.e. D:\\temp.<\/p>\n<p>Load the modules. Fileextension can be omitted is not necessary<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; Import-Module -Name  D:\\temp\\SpeculationControl\r\n<\/pre>\n<p>Check if Get-SpeculationControlSettings is available<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; get-help *spec*\r\n\r\nName                              Category  Module                    Synopsis\r\n----                              --------  ------                    --------\r\nGet-SpeculationControlSettings    Function  SpeculationControl        This function queries the speculatio\r\n<\/pre>\n<p>Thats it<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nPS D:\\&gt; Get-SpeculationControlSettings\r\nFor more information about the output below, please refer to https:\/\/support.micr\r\n\r\nSpeculation control settings for CVE-2017-5715 &#x5B;branch target injection]\r\n\r\nHardware support for branch target injection mitigation is present: True\r\nWindows OS support for branch target injection mitigation is present: True\r\n...\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, you just want to test a module and don&#8217;t want to install or copy it to the Powershell Modules directories? It&#8217;s possible \ud83d\ude42 For example the SpeculationControl module to query the speculation control (Spectre\/Meltdown vulnerability) settings of your system.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[344,5,4],"tags":[1369,1371,133,176,611,1370,20],"class_list":["post-6594","post","type-post","status-publish","format-standard","hentry","category-powershell-scripting","category-windowsknowhow","category-windowsscripts","tag-load-module-from-file","tag-meltdown","tag-powershell","tag-protection","tag-query","tag-spectre","tag-windows-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=6594"}],"version-history":[{"count":2,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6594\/revisions"}],"predecessor-version":[{"id":6597,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6594\/revisions\/6597"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=6594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=6594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=6594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}