Hi Luc,
When I use your function, I get the following error..
***********
Get-Inventory : Cannot validate argument on parameter 'Name'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
***********
Could it be because of $_ being Null??
I am importing a csv file with 2 columns VMName and BlueFolderFullPath.
After your function I am adding this line to get the info from the csv.
foreach ($VM in $ImportCSV)
{
Move-VM -VM $VM.VMName -Destination (Get-FolderByPath -Path $VM.BlueFolderFullPath)
}
Thanks,
Alberto