How to output value of a variable property in Read-Host/Powershell
@Answer = Read-Host -Prompt "Power Off $VM.Name yes/no"
I tried with ($VM.Name) and ($VM).Name which is not working.
CodePudding user response:
To expand the property you have to use $($VM.Name)
Read-Host -Prompt "Power Off $($VM.Name) yes/no"