<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Knowledge Base (Posts about powercli)</title><link>https://bgstack15.ddns.net/blog/</link><description></description><atom:link href="https://bgstack15.ddns.net/blog/categories/powercli.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2022 &lt;a href="mailto:bgstack15@gmail.com"&gt;bgstack15&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-SA"
style="border-width:0; margin-bottom:12px;"
src="https://bgstack15.ddns.net/.images/l_by-sa_4.0_88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Mon, 14 Mar 2022 18:59:20 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Rename VM via PowerCLI</title><link>https://bgstack15.ddns.net/blog/posts/2019/04/27/rename-vm-via-powercli/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;After a &lt;strong&gt;Get-VIServer -Server vcenter101&lt;/strong&gt; , of course.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Get-VM -Name test1 | Set-VM -Name test2 -Confirm:$false
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;References&lt;/h2&gt;
&lt;p&gt;Shamelessly ripped from &lt;a href="https://communities.vmware.com/message/2252707#2252707"&gt;Rename VM via PowerCLI |VMware
Communities&lt;/a&gt;&lt;/p&gt;</description><category>oneliner</category><category>powercli</category><category>vm</category><category>vmware</category><guid>https://bgstack15.ddns.net/blog/posts/2019/04/27/rename-vm-via-powercli/</guid><pubDate>Sat, 27 Apr 2019 13:21:24 GMT</pubDate></item><item><title>Install PowerShell and PowerCLI on CentOS 7 Linux</title><link>https://bgstack15.ddns.net/blog/posts/2019/04/15/install-powershell-and-powercli-on-centos-7-linux/</link><dc:creator>bgstack15</dc:creator><description>&lt;p&gt;I never thought I'd be doing this, but here's how to install PowerShell (yes,
that &lt;a href="https://en.wikipedia.org/wiki/PowerShell"&gt;Powershell&lt;/a&gt;) on our beloved
GNU/Linux. I need it because I want to automate some VMware tasks and PowerCLI
is available for Linux through powershell.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;curl https://packages.microsoft.com/config/rhel/7/prod.repo -o- | sudo tee /etc/yum.repos.d/microsoft.repo
sudo yum install -y powershell
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now powershell is installed, on GNU/Linux! Let's contain our horror and keep
moving forward. Open powershell and install the PowerCLI components.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pwsh
Set-PSRepository -Name "PSGallery" -InstallationPolicy "Trusted"
Find-Module "VMware.PowerCLI" | Install-Module -Scope "CurrentUser" -AllowClobber
Import-Module "VMware.PowerCLI"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;List what is available now with&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Get-Module "VMware.*" -ListAvailable | FT -Autosize
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And most VMware instances I've seen don't have pristine ssl certs, so you
might want to run:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Maintenance tasks include updating the PowerCLI modules.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Update-Module "VMware.PowerCLI"
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;References&lt;/h2&gt;
&lt;h3&gt;Weblinks&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Shamelessly ripped from &lt;a href="https://ithinkvirtual.com/2018/03/04/install-powershell-and-vmware-powercli-on-centos/"&gt;Install PowerShell and VMware PowerCLI on CentOS | iThinkVirtual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tech.zsoldier.com/2018/09/powercli-ssl-connection-could-not-be.html"&gt;Zsoldier's Tech Blog: PowerCLI: The SSL connection could not be established, see inner exception.&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description><category>powercli</category><category>powershell</category><category>vmware</category><guid>https://bgstack15.ddns.net/blog/posts/2019/04/15/install-powershell-and-powercli-on-centos-7-linux/</guid><pubDate>Mon, 15 Apr 2019 13:28:47 GMT</pubDate></item></channel></rss>