Yes. When I run the command in the script above, it lists the canonical name mulitple times, so when I pipe it into a variable, I'm not sure it's being read properly.
$LUN = Get-Datastore Datastore1 | get-scsilun | Select CanonicalName
When I do $LUN alone, I get this:
There are multiple hosts attached, as you can see.
I believe I need it to be just 1 line...