<?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>JDMils_Interact Tracker</title>
    <link>https://communities.vmware.com/wbsdv95928/tracker</link>
    <description>JDMils_Interact Tracker</description>
    <pubDate>Sun, 12 Nov 2023 00:59:26 GMT</pubDate>
    <dc:date>2023-11-12T00:59:26Z</dc:date>
    <item>
      <title>Re: Ignore Try..Catch on terminating errors</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2995014#M113811</link>
      <description>&lt;P&gt;I was using Get-Item -Location "C:\Temp" because I wanted to create a terminating error, then using the -ErrorAction Ignore, I was hoping the code would ignore the error and continue running.&lt;/P&gt;&lt;P&gt;This is just my way of testing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 22:05:45 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2995014#M113811</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-11-09T22:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore Try..Catch on terminating errors</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2994818#M113779</link>
      <description>&lt;P&gt;That's what I thought. When I run the code, it actually ALWAYS enters the Catch block as shown here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PS C:\Users\jmilano\Documents\PowerShell_Scripts\Datastores&amp;gt; C:\Users\jmilano\Documents\PowerShell_Scripts\TestTryCatch.ps1
Try this....
Try-Catch activated
Finally activated&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the Try..Catch to capture all major terminating errors, however I have one command which i do NOT want to terminate on, I just want the code to continue running. The problem is that the code ALWAYS enters the Catch block and I cannot figger out why I.&lt;/P&gt;&lt;P&gt;Note: Get-Item does not have a location parameter so this should trigger an error which I want to ignore. This is for testing purposes atm.&lt;/P&gt;&lt;P&gt;Even testing from the command line, ErrorAction doesn't work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PS C:\Users\jmilano\Documents\PowerShell_Scripts&amp;gt; get-item -location "c:\temp" -ErrorAction Continue
Get-Item : A parameter cannot be found that matches parameter name 'location'.
At line:1 char:10
+ get-item -location "c:\temp" -ErrorAction Continue
+          ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetItemCommand

PS C:\Users\jmilano\Documents\PowerShell_Scripts&amp;gt; get-item -location "c:\temp" -ErrorAction Ignore
Get-Item : A parameter cannot be found that matches parameter name 'location'.
At line:1 char:10
+ get-item -location "c:\temp" -ErrorAction Ignore
+          ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetItemCommand

PS C:\Users\jmilano\Documents\PowerShell_Scripts&amp;gt; get-item -location "c:\temp" -ErrorAction Inquire
Get-Item : A parameter cannot be found that matches parameter name 'location'.
At line:1 char:10
+ get-item -location "c:\temp" -ErrorAction Inquire
+          ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetItemCommand

PS C:\Users\jmilano\Documents\PowerShell_Scripts&amp;gt; get-item -location "c:\temp" -ErrorAction SilentlyContinue
Get-Item : A parameter cannot be found that matches parameter name 'location'.
At line:1 char:10
+ get-item -location "c:\temp" -ErrorAction SilentlyContinue
+          ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetItemCommand&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 23:01:11 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2994818#M113779</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-11-08T23:01:11Z</dc:date>
    </item>
    <item>
      <title>Ignore Try..Catch on terminating errors</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2994610#M113754</link>
      <description>&lt;P&gt;I'm very sorry for this basic question and I MUST be missing something obvious. I cannot get a terminating error located within a Try..Catch to be ignored and for processing to continue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;$ErrorActionPreference = "Ignore"
Try
    {
    Write-Host "Try this...."
    Get-Item -Location "C:\Temp" -ErrorAction Ignore
    Write-Host "Error ignored"
    }

Catch
    {
    Write-Host "Try-Catch activated"
    }
Finally
    {
    Write-Host "Finally activated"
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want the terminating error "Get-Item -Location "C:\Temp" -ErrorAction Ignore" to be ignored and processing to continue. In my testing, the Catch block is always processed.&lt;/P&gt;&lt;P&gt;My PS version:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;$PSVersionTable

Name                           Value                                                                                                                                                                                                                            
----                           -----                                                                                                                                                                                                                            
PSVersion                      5.1.14393.6343                                                                                                                                                                                                                   
PSEdition                      Desktop                                                                                                                                                                                                                          
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                          
BuildVersion                   10.0.14393.6343                                                                                                                                                                                                                  
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                  
WSManStackVersion              3.0                                                                                                                                                                                                                              
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                              
SerializationVersion           1.1.0.1             &lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 01:34:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Ignore-Try-Catch-on-terminating-errors/m-p/2994610#M113754</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-11-08T01:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect Serial Port</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994035#M113692</link>
      <description>&lt;P&gt;Hi LucD,&lt;/P&gt;&lt;P&gt;Your script looks gr8, can you modify it so that the serial ports which output to a file on a datastore are modified so that they can be pointed to a new datastore? I need this code in order to migrate VMs off datastores which are to be decomed.&lt;/P&gt;&lt;P&gt;I've noticed that when I manually edit the VM settings, the new com files are created on the new datastores however the old ones are still present on the original datastore?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 07:43:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disconnect-Serial-Port/m-p/2994035#M113692</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-11-03T07:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: virtual device ethernet0  will start disconnected</title>
      <link>https://communities.vmware.com/t5/vSphere-vNetwork-Discussions/virtual-device-ethernet0-will-start-disconnected/m-p/2992947#M14787</link>
      <description>&lt;P&gt;That does not sound right as vCenter associates the VLAN MoRef to the VM not the name so you can change the name to whatever you like whenever you like without any issues.&lt;/P&gt;&lt;P&gt;This issue is happening with me after decoming NSX-V from the hosts and taking the host out of maintenance. All VMs migrated to this host get the error "Virtual device 'Ethernet0' will start disconnected" and only this host from the 10 in total in this cluster.&lt;/P&gt;&lt;P&gt;I will report back with my findings.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 00:13:58 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-vNetwork-Discussions/virtual-device-ethernet0-will-start-disconnected/m-p/2992947#M14787</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-10-27T00:13:58Z</dc:date>
    </item>
    <item>
      <title>How to patch an ESXi server to 7.0u3g which is not connected to the internet?</title>
      <link>https://communities.vmware.com/t5/ESXi-Discussions/How-to-patch-an-ESXi-server-to-7-0u3g-which-is-not-connected-to/m-p/2990898#M290586</link>
      <description>&lt;P&gt;Thanks for the reply. So you are saying that if I download the 7.0u3g offline patch file, it will patch my hosts with all relevant Critical &amp;amp; Non-Critical patches?&lt;/P&gt;&lt;P&gt;If that's the case then thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 22:59:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/ESXi-Discussions/How-to-patch-an-ESXi-server-to-7-0u3g-which-is-not-connected-to/m-p/2990898#M290586</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-10-12T22:59:48Z</dc:date>
    </item>
    <item>
      <title>How to patch an ESXi server to 7.0u3g which is not connected to the internet?</title>
      <link>https://communities.vmware.com/t5/ESXi-Discussions/How-to-patch-an-ESXi-server-to-7-0u3g-which-is-not-connected-to/m-p/2990691#M290554</link>
      <description>&lt;P&gt;I have an isolated vCenter 7.0u3h so no connection to the internet. It has 2 hosts running ESXi 7.0u3d.&lt;/P&gt;&lt;P&gt;Normally I would create a patch baseline for 7.0u3g which automatically updates the baseline with all patches upto the date 1st Sep 2022. Then I would use this baseline to patch the hosts. But this works for internet-connected vCenters.&lt;/P&gt;&lt;P&gt;I tried downloading the ESXi 7.0u3g patch from the VMware download site, however I found that the host was still missing the required Critical &amp;amp; Non-Critical patches. My question is how do I select and download the Critical &amp;amp; Non-Critical patches from the VMware download site in order to patch the ESXi hosts offline?&lt;/P&gt;&lt;P&gt;Does the 7.0u3g download contain the Critical &amp;amp; Non-Critical updates as well?&lt;/P&gt;&lt;P&gt;&lt;A href="https://customerconnect.vmware.com/downloads/details?downloadGroup=ESXI70U3G&amp;amp;productId=974" target="_blank"&gt;https://customerconnect.vmware.com/downloads/details?downloadGroup=ESXI70U3G&amp;amp;productId=974&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 01:56:39 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/ESXi-Discussions/How-to-patch-an-ESXi-server-to-7-0u3g-which-is-not-connected-to/m-p/2990691#M290554</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-10-12T01:56:39Z</dc:date>
    </item>
    <item>
      <title>Get host CPUID information</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-host-CPUID-information/m-p/2986655#M113216</link>
      <description>&lt;P&gt;I'm looking at a vulnerability with Intel CPUs (&lt;A href="https://blogs.vmware.com/security/2023/08/cve-2022-40982.html" target="_blank" rel="noopener"&gt;https://blogs.vmware.com/security/2023/08/cve-2022-40982.html&lt;/A&gt;) and am looking at this page describing which CPUs are affected:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html" target="_blank" rel="noopener"&gt;https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are a few PowerCLI scripts which claim to give the CPUID for the hosts, but none that I have found will out put the results I need to compare to the Intel page above.&lt;/P&gt;&lt;P&gt;Does anyone have any pointers?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I just needed 2 more minutes after posting this to get the answer I needed!&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/fgrehl/virten-scripts/blob/master/powershell/get-cpuid.ps1" target="_blank"&gt;https://github.com/fgrehl/virten-scripts/blob/master/powershell/get-cpuid.ps1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 02:18:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-host-CPUID-information/m-p/2986655#M113216</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-09-14T02:18:52Z</dc:date>
    </item>
    <item>
      <title>vMotion fails with error "A general system error occurred: Invalid fault"</title>
      <link>https://communities.vmware.com/t5/VMware-vSphere-Discussions/vMotion-fails-with-error-quot-A-general-system-error-occurred/m-p/2980986#M45799</link>
      <description>&lt;P&gt;The guys in the team were upgrading an ESXi 6.7u3q host to 7.0u3g and they found that once upgraded, they could not vMotion powered on VMs to the host. Error they were seeing was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Task Name: Relocate virtual machine
Status: A general system error occurred: Invalid fault &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked hostd.log and found the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023-08-05T20:10:26.207Z info hostd[2099895] [Originator@6876 sub=AdapterServer opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] AdapterServer caught exception; &amp;lt;&amp;lt;5217f91e-b388-dd1a-0bcc-b971cade8b0f, &amp;lt;TCP '127.0.0.1 : 8307'&amp;gt;, &amp;lt;TCP '127.0.0.1 : 56080'&amp;gt;&amp;gt;, ha-vmotionmgr, vim.host.VMotionManager.initiateDestination&amp;gt;, N3Vim5Fault19PlatformConfigFault9ExceptionE(Fault cause: vim.fault.PlatformConfigFault
--&amp;gt; )
--&amp;gt; [context]zKq7AVICAgAAAKEvNgENaG9zdGQAACJDF2xpYnZtYWNvcmUuc28AAX/nz2hvc3RkAAF6988B/mHPAXyPXwGoL1+CWQ8ZAWxpYnZpbS10eXBlcy5zbwABipJSAKzHLQA0Ay4A4hA/Azt9AGxpYnB0aHJlYWQuc28uMAAEbdEObGliYy5zby42AA==[/context]
2023-08-05T20:10:26.215Z info hostd[2099895] [Originator@6876 sub=Solo.Vmomi opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] Activation finished; &amp;lt;&amp;lt;5217f91e-b388-dd1a-0bcc-b971cade8b0f, &amp;lt;TCP '127.0.0.1 : 8307'&amp;gt;, &amp;lt;TCP '127.0.0.1 : 56080'&amp;gt;&amp;gt;, ha-vmotionmgr, vim.host.VMotionManager.initiateDestination&amp;gt;
2023-08-05T20:10:26.215Z verbose hostd[2099895] [Originator@6876 sub=Solo.Vmomi opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] Arg migrationId:
--&amp;gt; 1011845975857744995
2023-08-05T20:10:26.215Z verbose hostd[2099895] [Originator@6876 sub=Solo.Vmomi opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] Arg dstConfigPath:
--&amp;gt; "/vmfs/volumes/41f8fd2d-4a203baa/MyServer-Test-74yN/MyServer-Test-74yN.vmx"
2023-08-05T20:10:26.215Z info hostd[2099895] [Originator@6876 sub=Solo.Vmomi opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] Throw vim.fault.PlatformConfigFault
2023-08-05T20:10:26.215Z info hostd[2099895] [Originator@6876 sub=Solo.Vmomi opID=lib2tr14-392654-auto-8ez3-h5:70076941-cc-01-48-4f75 user=vpxuser:VSPHERE.LOCAL\Administrator] Result:
--&amp;gt; (vim.fault.PlatformConfigFault) {
--&amp;gt;    text = "Failed to attach all ports",
--&amp;gt;    msg = "",
--&amp;gt; }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Turns out the guys forgot to install the new V7.0 host license!&lt;/P&gt;&lt;P&gt;I thought I'd put this out there as I initially spent about 20 minutes on wild goose chases until I found the problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2023 21:05:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-vSphere-Discussions/vMotion-fails-with-error-quot-A-general-system-error-occurred/m-p/2980986#M45799</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-08-05T21:05:54Z</dc:date>
    </item>
    <item>
      <title>How can I find duplicate UUIDs in vCD?</title>
      <link>https://communities.vmware.com/t5/VMware-vCloud-Director/How-can-I-find-duplicate-UUIDs-in-vCD/m-p/2978216#M13585</link>
      <description>&lt;P&gt;I use Zerto to replicate customer VMs from one site to another, however Zerto "freaks out" when it finds different VMs with the same UUID in vCloud Director.&lt;/P&gt;&lt;P&gt;Zerto support found 2 VMs with the same UUID such as this one:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;ID = 'urn:vcloud:vm:2ec418fe-23d0-4ff4-62ba-b5f72c347ceb'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I thus want to know if it is possible to find duplicate vCloud Director UUIDs for virtual servers? Can this be done in PowerShell?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 01:20:05 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-vCloud-Director/How-can-I-find-duplicate-UUIDs-in-vCD/m-p/2978216#M13585</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-07-20T01:20:05Z</dc:date>
    </item>
    <item>
      <title>How do I migrate VMs from one host to another when vCD is present?</title>
      <link>https://communities.vmware.com/t5/VMware-vSphere-Discussions/How-do-I-migrate-VMs-from-one-host-to-another-when-vCD-is/m-p/2977729#M45626</link>
      <description>&lt;P&gt;I'm planning to perform maintenance on my hosts and need to put them into maintenance to do this. My question is: If the hosts contain a number of VMs which are present in vCD inside vApps, can the host-2-host migration still be done in vCenter without affecting vCD?&lt;/P&gt;&lt;P&gt;I know that vCD can get upset when certain changes are made to a VM from vCenter instead of vCD so I wanted to check if host-migrations are OK when performed from vCenter.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 00:33:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-vSphere-Discussions/How-do-I-migrate-VMs-from-one-host-to-another-when-vCD-is/m-p/2977729#M45626</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-07-18T00:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Strange issue- Move-VM moves the VM, however it also errors out!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965629#M111715</link>
      <description>&lt;P&gt;Another code change I had to make was in the calling line:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;# Move-VMThin (Get-VM $oTemplateAsVM) (Get-Datastore $TargetDS)
Move-VMThin -VM $($oTemplateAsVM.Name) -Datastore $DatastoreName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Had to change the -VM &amp;amp; Datastore to strings.&lt;/P&gt;&lt;P&gt;One other thing I need your help with is that, surprisingly to me, you can have more than one template in a vCenter with the SAME name!?&lt;/P&gt;&lt;P&gt;So this line returns multiple objects:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$vmView = Get-View -ViewType VirtualMachine -Filter @{"Name" = "$VM"}&lt;/LI-CODE&gt;&lt;P&gt;If there's no way to fix this then all I can do is check for $vmView.Count and anything gt 1 will get a message to the user to say something like "Sorry, too many objects returned- do this one manually".&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 07:05:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965629#M111715</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-26T07:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Strange issue- Move-VM moves the VM, however it also errors out!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965621#M111712</link>
      <description>&lt;P&gt;Hmmm, with the new code it now no longer storage migrates the Template/VM and errors with:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$Error[0]
Exception calling "RelocateVM" with "2" argument(s): "Invalid configuration for device '13'."
At C:\Users\jmilano\Documents\PowerShell_Scripts\Datastores\2023-03-04 NetApp Datastore Migration\Storage-MigrateTemplates.ps1:150 char:9
+         $vmView.RelocateVM($spec, $null)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException&lt;/LI-CODE&gt;&lt;P&gt;I think this code exposes the "real" issue- that the connected portgroup to the template is not valid. I fixed the above issue by disconnecting the network from the VM and converting it back to a template and the script storage migrated it OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll keep testing to see what happens with the rest of the templates.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:46:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965621#M111712</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-26T06:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Strange issue- Move-VM moves the VM, however it also errors out!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965602#M111709</link>
      <description>&lt;P&gt;The code I'm using actually came with another module to migrate the templates after they were converted to VMs, and I re-instated the module and it actually migrates the VMs with no issues. Here it is:&lt;/P&gt;&lt;P&gt;Call the new module using this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;# $MoveVMToDS = Move-VM -VM (Get-VM -Name $oTemplateAsVM) -Datastore ($TargetDS) -Confirm:$false -ErrorAction Stop
Move-VMThin (Get-VM $oTemplateAsVM) (Get-Datastore $TargetDS)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;function Move-VMThin 
    {
    PARAM(
        [Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="Virtual Machine Objects to Migrate")]
        [ValidateNotNullOrEmpty()]
        [System.String]$VM,
            
        [Parameter(Mandatory=$true,HelpMessage="Destination Datastore")]
        [ValidateNotNullOrEmpty()]
        [System.String]$Datastore
        )

     Begin 
        {
        #Nothing Necessary to process
        } #Begin

    Process 
        {
        #Prepare Migration info, uses .NET API to specify a transformation to thin disk
        $vmView = Get-View -ViewType VirtualMachine -Filter @{"Name" = "$VM"}
        $dsView = Get-View -ViewType Datastore -Filter @{"Name" = "$Datastore"}

        #Abort Migration if free space on destination datastore is less than 50GB
        if (($dsView.info.freespace / 1GB) -lt 50) {throw "Move-ThinVM ERROR: Destination Datastore $Datastore has less than 50GB of free space. This script requires at least 50GB of free space for safety. Please free up space or use the VMWare Client to perform this Migration"}

        #Prepare VM Relocation Specificatoin
        $spec = New-Object VMware.Vim.VirtualMachineRelocateSpec
        $spec.datastore =  $dsView.MoRef
        $spec.transform = "sparse"

        #Perform Migration
        $vmView.RelocateVM($spec, $null)

        $MoveResult = Move-VM -VM $VM -Datastore $Datastore
        } #Process
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, this was a code module posted by you in this thread a while back:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/SVmotion-source-thick-disk-gt-svmotion-gt-should-become-thin/td-p/2120625" target="_blank" rel="noopener"&gt;https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/SVmotion-source-thick-disk-gt-svmotion-gt-should-become-thin/td-p/2120625&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So I really would love to know why the original Move-VM would migrate the template-convertedTo-VM and ALSO produce an error (Operation is not valid due to the current state of the object.).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 00:04:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965602#M111709</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-26T00:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Strange issue- Move-VM moves the VM, however it also errors out!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965601#M111708</link>
      <description>&lt;P&gt;Thanks LucD, same issue. It's so strange that I don't think there will be a fix for this. It just does not make sense!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 23:41:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965601#M111708</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-25T23:41:03Z</dc:date>
    </item>
    <item>
      <title>Strange issue- Move-VM moves the VM, however it also errors out!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965133#M111676</link>
      <description>&lt;P&gt;The script below is used to storage vmotion Templates by first converting them into VMs, migrate them, then convert them back again to a template. Strangely, the Move-VM command starts a storage migration, as viewed in the vCenter GUI, however it also errors out!?? I cannot figure out why it is doing this! And it seems to be doing it with all my templates.&lt;/P&gt;&lt;P&gt;I tested this from a PowerShell command line and the PowerShell IDE- same result.&lt;/P&gt;&lt;P&gt;Function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;function Move-VMTemplate
    {
    # This function will migrate a template VM to the target datastore.
    # The template is first converted to a VM,
    # then migrated, then converted back to a template.
    param(
        [string] $TemplateName, 
        [string] $DatastoreName
        )

 #   Try
 #       {
        if($TemplateName -eq ""){Write-Host "Enter a Template name"}
        if($DatastoreName -ne ""){$svmotion = $true}

        # Firstly, verify we have a target datastore presented to the vCenter:
        $TargetDS = Get-Datastore $DatastoreName -ErrorAction Stop

        Write-Host "$LineItem2 Converting to VM." -ForegroundColor DarkCyan
        # Convert the template to a VM.
        $oTemplateAsVM = Set-Template -Template (Get-Template $TemplateName) -ToVM -ErrorAction Stop

        Write-Host "$LineItem2 Migrate template to target datastore." -ForegroundColor DarkCyan
        # Move the VM to the target datastore.
    
        $MoveVMToDS = Move-VM -VM (Get-VM $oTemplateAsVM) -Datastore ($TargetDS) -Confirm:$false -ErrorAction Stop
        # Move-VMThin (Get-VM $oTemplateAsVM) (Get-Datastore $fDatastore)

        Write-Host "$LineItem2 Converting VM to template." -ForegroundColor DarkCyan
        # Convert the VM back to a template.
        (Get-VM $oTemplateAsVM | Get-View).MarkAsTemplate() | Out-Null
        Write-Host "$LineItem2 Conversion done." -ForegroundColor Green
 #       }

&amp;lt;#    Catch
        {
        Write-Host "$LineItem2 Error: $($PSItem.ToString())." -ForegroundColor Red
        Write-Host "$LineItem2 Skipping template [$TemplateName]." -ForegroundColor Red
        }
 #&amp;gt;   }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took out the Try/Catch just to see if I could get more info.&lt;/P&gt;&lt;P&gt;The function is called with this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$MoveVMTemplate = Move-VMTemplate -template $TemplateName -datastore $NewDatastoreName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the values of the variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$TemplateName
nashadow_RHEL6.5-x64_SOE_v1.1_mgt_t1_syd_vmdata_0001

$NewDatastoreName
mgt_t1_syd_vmdata_0003

$TargetDS
Name                               FreeSpaceGB      CapacityGB
----                               -----------      ----------
mgt_t1_syd_vmdata_0003           4,659.154       4,680.000

(Get-VM $oTemplateAsVM)
Name                 PowerState Num CPUs MemoryGB       
----                 ---------- -------- --------       
nashadow_RHEL6.5-... PoweredOff 1        2.000          &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Template is currently sitting on datastore "mgt_t1_syd_vmdata_0001 ".&lt;/P&gt;&lt;P&gt;When the Move-VM line executes, a new task appears in the vCenter GUI showing the VM being migrated, and it completes without issues, however the script produces the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$PSItem
Move-VM : 22/04/2023 6:01:33 PM	Move-VM		Operation is not valid due to the current state of the object.	
At C:\Users\jmilano\Documents\PowerShell_Scripts\Datastores\2023-03-04 NetApp Datastore Migration\Storage-MigrateTemplates.ps1:102 char:23
+ ... oveVMToDS = Move-VM -VM (Get-VM $oTemplateAsVM) -Datastore ($TargetDS ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Move-VM], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "CS/DVD Drive 1" is set to "Client Device" and not connected. The Template has one 60GB hard disk.&lt;/P&gt;&lt;P&gt;I can manually migrate the template once converted to a VM, using the vCenter GUI without issues. I can then migrate it back to its original datastore.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;$PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      14393  5582    

$PSVersionTable

Name                           Value                                                                                                                                                                                                                            
----                           -----                                                                                                                                                                                                                            
PSVersion                      5.1.14393.5582                                                                                                                                                                                                                   
PSEdition                      Desktop                                                                                                                                                                                                                          
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                          
BuildVersion                   10.0.14393.5582                                                                                                                                                                                                                  
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                  
WSManStackVersion              3.0                                                                                                                                                                                                                              
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                              
SerializationVersion           1.1.0.1                                                                                                                                                                                                                          


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 08:17:27 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Strange-issue-Move-VM-moves-the-VM-however-it-also-errors-out/m-p/2965133#M111676</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-22T08:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Disable DRS rule then enable it</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disable-DRS-rule-then-enable-it/m-p/2964324#M111607</link>
      <description>&lt;P&gt;Sorry, for some reason this was not working earlier but is working OK now:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$DRSRuleDisabled = $DRSRule | Set-DRSVMHostRule -Enabled $False
$DRSRuleDisabled = $DRSRule | Set-DRSVMHostRule -Enabled $True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Done!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 05:48:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disable-DRS-rule-then-enable-it/m-p/2964324#M111607</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-18T05:48:56Z</dc:date>
    </item>
    <item>
      <title>Disable DRS rule then enable it</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disable-DRS-rule-then-enable-it/m-p/2964318#M111606</link>
      <description>&lt;P&gt;I'm writing a VM migration script to storage migrate VMs form old to new datastores. In the situation where a VM has its swap file on a datastore which is designated as a host swap file (Configure | Swap File Location | Default swap file location),and you change the host's swap file location to a new datastore, the only way to migrate the VMs off the old swap datastore to the new is to host-migrate the VMs.&lt;/P&gt;&lt;P&gt;My script will host-migrate the VM from host1 to host2 back to host1 which effectively moves the VM's swap file to the newly setup host swap file. One issue is that if there are DRS Host Rules pinning the VM to a specific host, my code fails. I thus need to disable any rules which that VM is a part of, host-migrate the VM then re-enable those rules.&lt;/P&gt;&lt;P&gt;So far I've been able to get this code to work, which gets the DRS host rules which the respective VM is part of:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$VMHostGroup = Get-VM -Name $VMName | Select Name,@{N='DRSGroup';E={$script:group = Get-DrsClusterGroup -VM $_; $script:group.Name}},@{N='GroupType';E={$script:group.GroupType}}
$DRSRule = Get-DrsVMHostRule -Cluster $MyCluster -VMGroup $VMHostGroup.drsgroup&lt;/LI-CODE&gt;&lt;P&gt;How do I disable the rules, do my thing with the VM, then enable the rules afterwards?&lt;/P&gt;&lt;P&gt;Major Minor Build Revision&lt;BR /&gt;----- ----- ----- --------&lt;BR /&gt;5 1 14393 5582&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 05:35:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Disable-DRS-rule-then-enable-it/m-p/2964318#M111606</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-18T05:35:29Z</dc:date>
    </item>
    <item>
      <title>How to properly export ESXi host boot devices to CSV</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-properly-export-ESXi-host-boot-devices-to-CSV/m-p/2964284#M111602</link>
      <description>&lt;P&gt;I am using the script written by William Lam called "Get-ESXiBootDevice" (&lt;A href="https://www.powershellgallery.com/packages/AsBuiltReport.VMware.vSphere/1.2.1/Content/Src%5CPrivate%5CGet-ESXiBootDevice.ps1" target="_blank" rel="noopener"&gt;https://www.powershellgallery.com/packages/AsBuiltReport.VMware.vSphere/1.2.1/Content/Src%5CPrivate%5CGet-ESXiBootDevice.ps1&lt;/A&gt;) and it exports the data correctly to the console:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt; Get-ESXiBootDevice *

Host                                           Device                                                                       BootType Vendor Model            SizeMB IsSAS IsSSD IsUSB
----                                           ------                                                                       -------- ------ -----            ------ ----- ----- -----
MyHost01.MyDomain    naa.600a098038303455575d484d46442f59                                         remote   NETAPP LUN C-Mode       10240  false false false
MyHost02.MyDomain    naa.600a098038303455575d484d46442f2f                                         remote   NETAPP LUN C-Mode       10240  false false false
MyHost03.MyDomain    naa.600a098038303455575d484d46442f5a                                         remote   NETAPP LUN C-Mode       10240  false false false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, now when I try to export the results to a CSV, I get this in the CSV file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;et-ESXiBootDevice * | export-csv -Path MyvCenter_Host_BootDevices.csv -NoTypeInformation -UseCulture

"ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry"
"033ecb2bc07a4d43b5ef94ed5a35d280",,,"Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo","Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo",
"9e210fe47d09416682b841769c78b8a3",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I even wrote code to loop thru each host individually and return the results with the same outcome:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;$oVMHosts = Get-VMHost *
$HostBootDevices = @()
ForEach ($oVMHost in $oVMHosts)
    {
    $VMHostBootDevice = Get-ESXIBootDevice ($oVMHost)
    $HostBootDevices += $VMHostBootDevice
    }

$HostBootDevices | export-csv -Path MyvCenter_Host_BootDevices.csv -NoTypeInformation -UseCulture&lt;/LI-CODE&gt;&lt;P&gt;What is the correct way to export the data to CSV?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 00:26:43 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/How-to-properly-export-ESXi-host-boot-devices-to-CSV/m-p/2964284#M111602</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-04-18T00:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Test if a datastore is read/write</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Test-if-a-datastore-is-read-write/m-p/2958219#M111067</link>
      <description>&lt;P&gt;Sorry for any confusion. Let me explain better.&lt;/P&gt;&lt;P&gt;Further up in my code there is a section which adds the datastore to the host. Sometimes the storage guys forget to make the underlying LUN writable, so it is presented to the host as a read-only datastore. Then when I run my VM storage migration during my change window, I find the new datastores are read-only and I have to scramble to get a storage resource to fix it. We are talking about replacing 50 datastores on many vCenters so it needs to be automated.&lt;/P&gt;&lt;P&gt;The other part of the script will add the new datastores to each respective hosts, and it should test that the datastore is writable, by creating a test folder and then deleting the folder from the datastore.&lt;/P&gt;&lt;P&gt;I found the issue. It's not about removing the PSDrive, it was more about removing the folder from the datastore after it was created, and I found that Remove-Item is what I needed. So here's the resulting, working script, which tests if a datastore is writable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#
# Function to test read/write properties of a datastore by
# creating a folder on the new datastore then delete the folder.
Function CheckDSReadWriteOK
    {
    Param(
        [STRING]$HostObject = '',
        [STRING]$DatastoreName = '',
        [STRING]$RemotePath = ''
        )
    Try
        {
        $TestDatastoreFolderName = "DS:\NEW_FOLDER"
        # Get the new datastore.
        $oDatastore = Get-Datastore -VMHost $HostObject -Name $DatastoreName
        # Ensure we get a catch-able error if something goes wrong.
        $ErrorActionPreference = "Stop"
        # Create the drive connection.
        $NewPSDrive = New-PSDrive -Location $oDatastore -Name DS -PSProvider VimDatastore -Root "\"
        # Create the test folder. If this fails, the datastore is most-likely in read-only mode.
        $NewPSFolder = New-Item -Path $TestDatastoreFolderName -ItemType Directory
        # If all went well, remove the test folder from the datastore.
        $RemovePSFolder = Remove-Item -Path $TestDatastoreFolderName -Confirm:$false
        # Remove the drive connection
        $RemovePSDrive = Remove-PSDrive -Name DS -Confirm:$false
        $ErrorActionPreference = “Continue”
        }
    Catch
        {
        Write-Host "$StringText_DS $StringText_Host- The datastore is NOT writeable." -ForegroundColor Red
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 22:22:18 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Test-if-a-datastore-is-read-write/m-p/2958219#M111067</guid>
      <dc:creator>JDMils_Interact</dc:creator>
      <dc:date>2023-03-07T22:22:18Z</dc:date>
    </item>
  </channel>
</rss>

