OK, I Zero'd in on the segment of my commandline that is generating the below warnings....
WARNING: The 'IsChildTypeVm' property of the Folder type is deprecated. Use the Type property instead.
WARNING: The 'IsChildTypeComputeResource' property of the Folder type is deprecated. Use the Type property instead.
WARNING: The 'IsChildTypeDatacenter' property of the Folder type is deprecated. Use the Type property instead.
WARNING: The 'IsChildTypeDatastore' property of the Folder type is deprecated. Use the Type property instead.
The offending segment is this...
(Get-Folder -ID (Get-VM $SourceVM).FolderId)
I'm pretty sure I am not trying to enumerate any of the items listed in the warnings.
This segment gets me the folder that my source vm is in. I need this because I will be cloning a vm and I want to put it in the same folder as the source.
Simple right?
My entire script works fine but I want to get the proper workaround for the offending segment so I don't get bit in the buttox later when the features stop working when the next release comes out.
Whats the supported substitute for: (Get-Folder -ID (Get-VM $SourceVM).FolderId) ?????
Thanks
You get those depreciation warnings when you use the cmdlet, you don't have to use the deprecated method or access the deprecated property for that.
Since you are not using these methods, just ignore them.
And perhaps disable these depreciation warnings for your script, through the Set-PowerCLIConfiguration cmdlet.
Btw, which PowerCLI and PowerShell version are you using?
I can't seem to be able to replicate these warnings.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You get those depreciation warnings when you use the cmdlet, you don't have to use the deprecated method or access the deprecated property for that.
Since you are not using these methods, just ignore them.
And perhaps disable these depreciation warnings for your script, through the Set-PowerCLIConfiguration cmdlet.
Btw, which PowerCLI and PowerShell version are you using?
I can't seem to be able to replicate these warnings.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Here's the version I am on...
PowerCLI Version
----------------
VMware vSphere PowerCLI 6.3 Release 1 build 3737840
What version are you on? I may need to upgrade.
Thanks
I'm currently on PowerCLI 6.5.2.
But be aware that since PowerCLI 6.5.1 there are no more MSI files to install PowerCLI.
You will have to get the latest PowerCLI version from the PowerShell Gallery.
See Updating PowerCLI through the PowerShell Gallery for instructions.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
