{"id":947,"date":"2020-08-05T15:53:43","date_gmt":"2020-08-05T20:53:43","guid":{"rendered":"http:\/\/zewwy.ca\/?p=947"},"modified":"2020-08-05T15:53:43","modified_gmt":"2020-08-05T20:53:43","slug":"installing-powercli-12-0-offline","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2020\/08\/05\/installing-powercli-12-0-offline\/","title":{"rendered":"Installing PowerCLI 12.0 Offline"},"content":{"rendered":"<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"PowerCLI_120\"><\/span>PowerCLI 12.0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Offline_Install\"><\/span>Offline Install<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Checking VMwares source wasn&#8217;t too insightful&#8230;<\/p>\n<p><a href=\"https:\/\/code.vmware.com\/web\/tool\/12.0.0\/vmware-powercli\">Just this<\/a> with the &#8220;Download&#8221; button redirecting to <a href=\"https:\/\/www.powershellgallery.com\/packages\/VMware.PowerCLI\/12.0.0.15947286\">an alternative site non-other than powershellgallery.com<\/a> &#8230;clicking manual Download gives you the raw nuget package let&#8217;s try to install first normally.<\/p>\n<pre>Install-Module -Name VMware.PowerCLI<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/0BL2vls.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/0BL2vls.png\" alt=\"\" width=\"847\" height=\"578\" \/><\/a><\/p>\n<p>No way it failed, expected, and it even states a warning about the network.<\/p>\n<p>Alright so using an online computer copy the nuget package to the offline (use USB sticks, Floppy drives, Zip Drives, serial modem if that&#8217;s what it takes&#8230;)<\/p>\n<p>In my case I was testing this on a VM and simply used a USB stick to mount it to the VM from the VMRC console, and copied the nuget file to c:\\temp\\PowerCLI<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/IgJAo50.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/IgJAo50.png\" alt=\"\" width=\"668\" height=\"165\" \/><\/a><\/p>\n<p>This from <a href=\"https:\/\/docs.microsoft.com\/en-us\/nuget\/reference\/ps-reference\/ps-ref-install-package\">this MS Doc page<\/a> on the cmdlet, is for Visual Studio, we are using powershell only&#8230;<\/p>\n<p><em>This topic describes the command within the\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/nuget\/consume-packages\/install-use-packages-powershell\" data-linktype=\"relative-path\">Package Manager Console<\/a>\u00a0in Visual Studio on Windows. For the generic PowerShell Install-Package command, see the\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/packagemanagement\/?view=powershell-6\" data-linktype=\"absolute-path\">PowerShell PackageManagement reference<\/a>.<\/em><\/p>\n<p>Sure enough this is where I gave up on this path. All the new stuff is nice with it all being connected makes life super easy, but in those locked down situations this is a hassel. Since I wasn&#8217;t sure how to install the nuget package via a simple ID option like Install-Package for VS PS, there wasn&#8217;t one for the regular PS Install-Package cmdlet. Then I went to google how to accomplish this and was a bit annoyed at all the steps required to do it via the package manager&#8230; <a href=\"https:\/\/stackoverflow.com\/questions\/51406685\/how-do-i-install-the-nuget-provider-for-powershell-on-a-unconnected-machine-so-i\">Read this by William on Stackoverflow<\/a> for more details.<\/p>\n<p>Lucky for me I found an <a href=\"https:\/\/www.elasticsky.de\/en\/2020\/01\/powercli-offline-installation\/\">alternative blog post<\/a>, which does an alternative offline install and much, much simpler.<\/p>\n<p>From the online system instead of saving the nuget package we save the modules files themselves directly.<\/p>\n<pre class=\"wp-block-preformatted\"> Save-Module -Name VMware.PowerCLI -Path C:\\temp\\PSModules<\/pre>\n<p>Copy the entire contents of the\u00a0<em>PSModules<\/em>\u00a0folder to a storage medium of your choice (e.g. USB flash drive) and transfer the files to the desired offline system where PowerCLI is needed.<\/p>\n<p>If you have admin rights on the target system, you can copy files to the location below.<\/p>\n<pre class=\"wp-block-preformatted\"> C:\\Program Files\\WindowsPowerShell\\Modules<\/pre>\n<p>At this point he goes on about some settings and stuff, I wasn&#8217;t exactly sure how to use PowerCLI, as usually it opens up in a custom PS window before. Now you simple import-module *modulename*<\/p>\n<pre>Import-Module VMware.PowerCLI<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/o3KfGay.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/o3KfGay.png\" alt=\"\" width=\"843\" height=\"314\" \/><\/a><\/p>\n<p>Now creating custom ESXi images should be a breeze!<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Extra_Bits\"><\/span>Extra Bits<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Customer_Experience_Improvement_Program_CEIP\"><\/span>Customer Experience Improvement Program (CEIP)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The VMware\u00a0<a href=\"https:\/\/www.vmware.com\/solutions\/trustvmware\/ceip.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Customer Experience Improvement Program (\u00f6ffnet in neuem Tab)\">Customer Experience Improvement Program<\/a>\u00a0collects data about the use of VMware products. You can either agree (true) or disagree (false). For offline systems, only the rejection (false) makes sense. The command shown below suppresses future notifications within PowerCLI.<\/p>\n<pre class=\"wp-block-preformatted\">Set-PowerCLIConfiguration -Scope AllUsers -ParticipateInCeip $false<\/pre>\n<h3><a href=\"https:\/\/i.imgur.com\/xYijzei.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/xYijzei.png\" alt=\"\" width=\"832\" height=\"166\" \/><\/a><\/h3>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Ignore_invalid_SSL_certificates\"><\/span>Ignore invalid SSL certificates<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When using self-signed certificates in vCenter, PowerCLI will deny the connection. This behavior can be suppressed with the command:<\/p>\n<pre class=\"wp-block-preformatted\">Set-PowerCLIConfiguration -Scope AllUsers -InvalidCertificateAction Warn<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/F4MyBv7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/F4MyBv7.png\" alt=\"\" width=\"836\" height=\"272\" \/><\/a><\/p>\n<p>Found <a href=\"https:\/\/pubs.vmware.com\/vsphere-51\/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FSet-PowerCLIConfiguration.html\">the types from this old 5.1 documentation<\/a> you can also set it to ignore instead of warn. \ud83d\ude42 Cheers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerCLI 12.0 Offline Install Checking VMwares source wasn&#8217;t too insightful&#8230; Just this with the &#8220;Download&#8221; button redirecting to an alternative site non-other than powershellgallery.com &#8230;clicking manual Download gives you the raw nuget package let&#8217;s try to install first normally. Install-Module -Name VMware.PowerCLI No way it failed, expected, and it even states a warning about the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2020\/08\/05\/installing-powercli-12-0-offline\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Installing PowerCLI 12.0 Offline&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[5,12],"tags":[291,290,88],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-hypervisors","category-powershell","tag-offline","tag-powercli","tag-vmware"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=947"}],"version-history":[{"count":2,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":1483,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/947\/revisions\/1483"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}