<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create alias in $profile to connect to all vCenters in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-alias-in-profile-to-connect-to-all-vCenters/m-p/2262353#M77984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create an alias for a cmdlet, but not for a cmdlet with parameters.&lt;/P&gt;&lt;P&gt;Why don't you define a function in your profile instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #00008b;"&gt;function&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;allvc&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;credential&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;import-clixml&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;path &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;C:\documents\PowerCLI\My-credfile.xml&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;vCenterServers&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #00008b;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa2&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa3&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa4&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa5&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;connect-viserver&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;vCenterServers&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Credential &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;credential&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Nov 2019 12:24:20 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2019-11-01T12:24:20Z</dc:date>
    <item>
      <title>Create alias in $profile to connect to all vCenters</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-alias-in-profile-to-connect-to-all-vCenters/m-p/2262352#M77983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is is possible to create an alias in $profile to connect to all your vCenters ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried but it doesn't work as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$credential = import-clixml -path 'C:\documents\PowerCLI\My-credfile.xml'&lt;/P&gt;&lt;P&gt;$vCenterServers = @("vcsa1","vcsa2","vcsa3","vcsa4","vcsa5")&lt;/P&gt;&lt;P&gt;new-alias allvc connect-viserver $vCenterServers -Credential $credential&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run it from commandline it works:&lt;/P&gt;&lt;P&gt;$credential = import-clixml -path 'C:\documents\PowerCLI\My-credfile.xml'&lt;/P&gt;&lt;P&gt;$vCenterServers = @("vcsa1","vcsa2","vcsa3","vcsa4","vcsa5")&lt;/P&gt;&lt;P&gt;connect-viserver $vCenterServers -Credential $credential&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2019 10:17:30 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-alias-in-profile-to-connect-to-all-vCenters/m-p/2262352#M77983</guid>
      <dc:creator>jravnsba1</dc:creator>
      <dc:date>2019-11-01T10:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create alias in $profile to connect to all vCenters</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-alias-in-profile-to-connect-to-all-vCenters/m-p/2262353#M77984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create an alias for a cmdlet, but not for a cmdlet with parameters.&lt;/P&gt;&lt;P&gt;Why don't you define a function in your profile instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #00008b;"&gt;function&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;allvc&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;credential&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;import-clixml&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;path &lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;C:\documents\PowerCLI\My-credfile.xml&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;vCenterServers&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #00008b;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa2&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa3&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa4&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #a9a9a9;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #8b0000;"&gt;vcsa5&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;connect-viserver&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;vCenterServers&lt;/SPAN&gt; &lt;SPAN style="color: #a9a9a9;"&gt;-&lt;/SPAN&gt;Credential &lt;SPAN style="color: #000000;"&gt;$&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;credential&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:24:20 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-alias-in-profile-to-connect-to-all-vCenters/m-p/2262353#M77984</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2019-11-01T12:24:20Z</dc:date>
    </item>
  </channel>
</rss>

