<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Invoke-VMScriptPlus v2	</title>
	<atom:link href="https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/</link>
	<description>My PowerShell ramblings</description>
	<lastBuildDate>Tue, 26 May 2020 23:10:27 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.9</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>
		By: Todd Ouimet		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4851</link>

		<dc:creator><![CDATA[Todd Ouimet]]></dc:creator>
		<pubDate>Tue, 26 May 2020 23:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4851</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4850&quot;&gt;LucD&lt;/a&gt;.

Oops sorry about that. I completely missed the latest version.  Once again, amazing work from LucD!  Thank you very much!]]></description>
			<content:encoded><![CDATA[<p>Oops sorry about that. I completely missed the latest version.  Once again, amazing work from LucD!  Thank you very much!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4850</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Tue, 26 May 2020 15:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4850</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4849&quot;&gt;Todd Ouimet&lt;/a&gt;.

Hi Todd,
Thanks, much appreciated.

That issue was resolved in the latest version, see &lt;a href=&quot;https://www.lucd.info/2019/11/17/invoke-vmscriptplus-v3/&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Invoke-VMScriptPlus V3&lt;/a&gt;
The update adds the new Switch -NoIPinCert, and some other new features.

Give it a try.
Luc]]></description>
			<content:encoded><![CDATA[<p>Hi Todd,<br />
Thanks, much appreciated.</p>
<p>That issue was resolved in the latest version, see <a href="https://www.lucd.info/2019/11/17/invoke-vmscriptplus-v3/" rel="noopener noreferrer" target="_blank">Invoke-VMScriptPlus V3</a><br />
The update adds the new Switch -NoIPinCert, and some other new features.</p>
<p>Give it a try.<br />
Luc</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Todd Ouimet		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4849</link>

		<dc:creator><![CDATA[Todd Ouimet]]></dc:creator>
		<pubDate>Tue, 26 May 2020 15:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4849</guid>

					<description><![CDATA[Hi LucD,

Thank you for such a great Function!!
I had an issue when running it. I would get:
Invoke-WebRequest : Unable to connect to the remote server

After digging into the code I saw you were replacing the $ip for the $hostname on line 247 which worked great for those of us that are using custom SSL certs on the host that does not include a SAN IP address.

It turned out the failure was coming from line 330 &#038; 331:
$fileInfo = $gFileMgr.InitiateFileTransferFromGuest($moref, $auth, $tempOutput)
$fileContent = Invoke-WebRequest -Uri $fileInfo.Url -Method Get

$fileInfo.Url contained the IP address not the hostname.  I added the following one line of code and modified line 331 and all works great now!!

$Url = ($fileInfo.Url).replace($ip, $hostName)
$fileContent = Invoke-WebRequest -Uri $Url -Method Get -Verbose

Running on Win2016, PowerShell version 5.1.14393.3471, VMware PowerCLI 11.5.0 build 14912921

Regards,
Todd]]></description>
			<content:encoded><![CDATA[<p>Hi LucD,</p>
<p>Thank you for such a great Function!!<br />
I had an issue when running it. I would get:<br />
Invoke-WebRequest : Unable to connect to the remote server</p>
<p>After digging into the code I saw you were replacing the $ip for the $hostname on line 247 which worked great for those of us that are using custom SSL certs on the host that does not include a SAN IP address.</p>
<p>It turned out the failure was coming from line 330 &amp; 331:<br />
$fileInfo = $gFileMgr.InitiateFileTransferFromGuest($moref, $auth, $tempOutput)<br />
$fileContent = Invoke-WebRequest -Uri $fileInfo.Url -Method Get</p>
<p>$fileInfo.Url contained the IP address not the hostname.  I added the following one line of code and modified line 331 and all works great now!!</p>
<p>$Url = ($fileInfo.Url).replace($ip, $hostName)<br />
$fileContent = Invoke-WebRequest -Uri $Url -Method Get -Verbose</p>
<p>Running on Win2016, PowerShell version 5.1.14393.3471, VMware PowerCLI 11.5.0 build 14912921</p>
<p>Regards,<br />
Todd</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4767</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Wed, 25 Dec 2019 14:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4767</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4765&quot;&gt;dion&lt;/a&gt;.

Hi again,
First, note that I started from the &lt;a href=&quot;https://www.lucd.info/2019/11/17/invoke-vmscriptplus-v3/&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Invoke-VMScriptPlus v3&lt;/a&gt; function.

The Resolve-DnsName cmdlet missing issue can be fixed by replacing that with
&lt;code&gt;
$hostName = [System.Net.Dns]::GetHostEntry($ip) &#124; Select-Object -expandProperty HostName
&lt;/code&gt;
Note that the cmdlet occurs twice in the function.

But in PS v7rc1, we then get a new error.

&lt;blockquote&gt;
Peer certificate cannot be authenticated with given CA certificates
&lt;/blockquote&gt;

This is currently still an open issue it seems (see &lt;a href=&quot;https://github.com/dotnet/corefx/issues/10146&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer nofollow ugc&quot;&gt;#10146&lt;/a&gt;).]]></description>
			<content:encoded><![CDATA[<p>Hi again,<br />
First, note that I started from the <a href="https://www.lucd.info/2019/11/17/invoke-vmscriptplus-v3/" rel="noopener noreferrer" target="_blank">Invoke-VMScriptPlus v3</a> function.</p>
<p>The Resolve-DnsName cmdlet missing issue can be fixed by replacing that with<br />
<code><br />
$hostName = [System.Net.Dns]::GetHostEntry($ip) | Select-Object -expandProperty HostName<br />
</code><br />
Note that the cmdlet occurs twice in the function.</p>
<p>But in PS v7rc1, we then get a new error.</p>
<blockquote><p>
Peer certificate cannot be authenticated with given CA certificates
</p></blockquote>
<p>This is currently still an open issue it seems (see <a href="https://github.com/dotnet/corefx/issues/10146" target="_blank" rel="noopener noreferrer nofollow ugc">#10146</a>).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4766</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Tue, 24 Dec 2019 23:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4766</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4765&quot;&gt;dion&lt;/a&gt;.

I&#039;ll have a look, let me get back to you.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll have a look, let me get back to you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dion		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4765</link>

		<dc:creator><![CDATA[dion]]></dc:creator>
		<pubDate>Tue, 24 Dec 2019 19:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4765</guid>

					<description><![CDATA[The prvious error was using v7 of powershell Core, in the vurrent version I get this error:

The term &#039;Resolve-DnsName&#039; is not recognized as the name of a cmdlet, function, script file, or operable program

as this relies on .Net and has not yet been ported.  So it seems more likely that it might work with v7 but there is that other string problem]]></description>
			<content:encoded><![CDATA[<p>The prvious error was using v7 of powershell Core, in the vurrent version I get this error:</p>
<p>The term &#8216;Resolve-DnsName&#8217; is not recognized as the name of a cmdlet, function, script file, or operable program</p>
<p>as this relies on .Net and has not yet been ported.  So it seems more likely that it might work with v7 but there is that other string problem</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dion		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4764</link>

		<dc:creator><![CDATA[Dion]]></dc:creator>
		<pubDate>Tue, 24 Dec 2019 18:36:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4764</guid>

					<description><![CDATA[I have users on linux who want to use powershell core but I get the following error when trying it from in Fedore 29:

Exception calling &quot;CreateTemporaryFileInGuest&quot; with &quot;5&quot; argument(s): &quot;Failed to authenticate with the guest operating system using the supplied credentials.&quot; 

Can VIX and or your script work on from Linux powershell ?]]></description>
			<content:encoded><![CDATA[<p>I have users on linux who want to use powershell core but I get the following error when trying it from in Fedore 29:</p>
<p>Exception calling &#8220;CreateTemporaryFileInGuest&#8221; with &#8220;5&#8221; argument(s): &#8220;Failed to authenticate with the guest operating system using the supplied credentials.&#8221; </p>
<p>Can VIX and or your script work on from Linux powershell ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4720</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Mon, 11 Nov 2019 13:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4720</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4717&quot;&gt;sylvain&lt;/a&gt;.

Thanks.

I&#039;m not convinced that the error you mention is related to the &#039;multiple&#039; mode.
That looks more like a VM that has just been created/removed, and where the VirtualMachine object that is passed to the function (the value on the VM parameter) has not been refreshed since.]]></description>
			<content:encoded><![CDATA[<p>Thanks.</p>
<p>I&#8217;m not convinced that the error you mention is related to the &#8216;multiple&#8217; mode.<br />
That looks more like a VM that has just been created/removed, and where the VirtualMachine object that is passed to the function (the value on the VM parameter) has not been refreshed since.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4719</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Mon, 11 Nov 2019 12:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4719</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4718&quot;&gt;Tanveer Ahmed&lt;/a&gt;.

I normally do this by starting a background process, and by waiting a couple of seconds to start the reboot.
This allows the Invoke-VMScriptPlus function, which requires the VMware Tools to be running, to come back correctly.

Something like this
&lt;code&gt;
$sInvoke = @{
    VM = $vm
    ScriptType = &#039;bash&#039;
    ScriptText = &#039;sudo bash -c &quot;sleep 10; reboot now&quot; &amp;&#039;
    GuestUser = $user
    GuestPassword = $pswd
}
Invoke-VMScript @sInvoke
&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>I normally do this by starting a background process, and by waiting a couple of seconds to start the reboot.<br />
This allows the Invoke-VMScriptPlus function, which requires the VMware Tools to be running, to come back correctly.</p>
<p>Something like this<br />
<code><br />
$sInvoke = @{<br />
    VM = $vm<br />
    ScriptType = 'bash'<br />
    ScriptText = 'sudo bash -c "sleep 10; reboot now" &#038;'<br />
    GuestUser = $user<br />
    GuestPassword = $pswd<br />
}<br />
Invoke-VMScript @sInvoke<br />
</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tanveer Ahmed		</title>
		<link>https://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/#comment-4718</link>

		<dc:creator><![CDATA[Tanveer Ahmed]]></dc:creator>
		<pubDate>Mon, 11 Nov 2019 12:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=5804#comment-4718</guid>

					<description><![CDATA[Hey Luc,

I am trying to reboot a Ubuntu box using invoke-VMscriptplus , all other commands are working fine where I am fetching the information however, the reboot command is not rebooting the box.

any help will be appreciated.]]></description>
			<content:encoded><![CDATA[<p>Hey Luc,</p>
<p>I am trying to reboot a Ubuntu box using invoke-VMscriptplus , all other commands are working fine where I am fetching the information however, the reboot command is not rebooting the box.</p>
<p>any help will be appreciated.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
