Did you try with single quotes?
$vm.datastorefullpath = '[IOMEGA_lun01] myvm-new-1/myvm-new-1.vmx'
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
------------------------------
Original Message:
Sent: Jan 06, 2025 04:41 PM
From: dbutch1976
Subject: Get contents from within the square brackets
Hello,
Hopefully this is an easy question:
I need to get a datastore name from within the square brackets of a field of an array:
$vm.datastorefullpath = [IOMEGA_lun01] myvm-new-1/myvm-new-1.vmx
Trying to get the datastore name so I can use it here:
Get-Datastore -Name ???
Thanks!