Hello, appending a single datastore works fine, but, appending a list from CSV didn't work fine with me. I used this example:
Get-Content ".\rename-ds.csv" | ConvertFrom-Csv -header nfsname | %{get-datastore $_.nfsname } | Set-Datas
tore -Name $nfsname"-DONTUSE"
Try something like this
ForEach-Object -Process {
Get-Datastore -Name $_.nfsname |
Set-Datastore -Name "$($_.Name)-DONTUSE" -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks, but, where should I declare the var "$_.nfsname" ?
That should come from your CSV file.
I assumed from your sample snippet, that the CSV had the following layout.
nfsname
datastore1
datastore2
The Import-Csv reads the file line-by-line, and the line ($_) contains the nfsname property
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Okay, though, not working at all I've verified the names an they are still the same.
Can you show the script and the CSV file?
That line in the output, with the datastore info, should not be there.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference