multiline command parsing
what's explanation keeps
[system.enum]::getvalues([`
system.serviceprocess.servicecontrollerstatus`
])
from parsing same as
[system.enum]::getvalues(`
[system.serviceprocess.servicecontrollerstatus]`
)
in second example not actualy need escape newlines. ;)
re: why ps not understand first one:
guess need have complete tokens e.g.:
g`
wmi
won't work either - backtick not cure linebreak. same with:
[system.enum]:`
:getvalues(
while:
[system.enum]::`
getvalues(
works. can use tokenizer see parts can't broken linebreaks , glued backtick:
[management.automation.psparser]::tokenize('[system.enum]::getvalues([microsoft.powershell.executionpolicy])', [ref]$null)
Windows Server > Windows PowerShell
Comments
Post a Comment