I need to show all vms in a list of datastores
get-content luns.txt | % { get-datastore -name $_ | get- vm}
it shows nothing
am i gettin this right?
How does that luns.txt file look?
A single datastorename per line, no blank lines?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes one datastore per line.
I am trying to unmount the datastores and delete them with this
get-content luns.txt | % {get-datastore -name $_ | unmount-datastore }
but seems like it going forever in a loop?
Is this showing one datastorename per line?
Get-Content -Path luns.txt
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes
What is this Unmount-Datastore?
Is that the function from Datastore Mount/Unmount Detach/Attach functions?
Let's take this step-by-step
What does this return
Get-Content -Path luns.txt
And this?
Does it return all the datastores in luns.txt?
Get-Content -Path luns.txt | %{
Get-Datastore -Name $_
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference