I just entered the details of the destination path of the vm in csv and ran the script i got below given error. .not sure if am missing something here.
PowerCLI H:\MY DATA\Script Important\VMfoldermove> .\vmmove.ps1
Get-FolderByPath : The term 'Get-FolderByPath' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
At H:\MY DATA\Script Important\VMfoldermove\vmmove.ps1:5 char:15
+ $folder = Get-FolderByPath -Name $_.FolderName
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-FolderByPath:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Move-VM : Cannot validate argument on parameter 'Destination'. The argument is
null or empty. Provide an argument that is not null or empty, and then try the
command again.
At H:\MY DATA\Script Important\VMfoldermove\vmmove.ps1:7 char:34
+ Move-VM -VM $vm -Destination $folder
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Move-VM], ParameterBindingVali
dationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutom
ation.ViCore.Cmdlets.Commands.MoveVM
Get-FolderByPath : The term 'Get-FolderByPath' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try
again.
At H:\MY DATA\Script Important\VMfoldermove\vmmove.ps1:5 char:15
+ $folder = Get-FolderByPath -Name $_.FolderName
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-FolderByPath:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Move-VM : Cannot validate argument on parameter 'Destination'. The argument is
null or empty. Provide an argument that is not null or empty, and then try the
command again.
At H:\MY DATA\Script Important\VMfoldermove\vmmove.ps1:7 char:34
+ Move-VM -VM $vm -Destination $folder
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Move-VM], ParameterBindingVali
dationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutom
ation.ViCore.Cmdlets.Commands.MoveVM