Hi!
I have multiple bash commands.
In real time i type command, then enter, then enother command and enter again. etc
How i can use all command in 1 $script?
This dos'nt work:
$script = "
/sbin/pvresize
/sbin/lvresize
"
Invoke-VMScript -VM MyVM -ScriptType bash -ScriptText $script -GuestUser root -GuestPassword P@ssw0rd
Thanks!
Try with a here-string
$script = @'
/sbin/pvresize
/sbin/lvresize
'@
Invoke-VMScript -VM MyVM -ScriptType bash -ScriptText $script -GuestUser root -GuestPassword P@ssw0rd
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try with a here-string
$script = @'
/sbin/pvresize
/sbin/lvresize
'@
Invoke-VMScript -VM MyVM -ScriptType bash -ScriptText $script -GuestUser root -GuestPassword P@ssw0rd
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Many thanks!
They are, but it depends how you defined the script as inline text (with or without variable substitution), and if you escaped the dollar signs in the variables if you selected variable substitution.
Can you share you code, so I can have a look?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference