powershell - How can I have my variable output enclose with a semicolon -
any thought how can have variable output enclose in semicolon?
for example:
$animal = "cat"
my want output of $animal "cat" semicolon. can do?
i tried parsing semicolon output using ' have spaces around it. illustration if
write-host '"'$animal'"'
output " cat " space around it. wanted "cat"
thanks
try enclose in single quote:
$animal = '"cat"'
or if want utilize write-host
escape double quotes `
$animal = "cat" write-host "`"$animal`""
powershell
No comments:
Post a Comment