by selko at 2013-02-17 22:37:46
Hi,
i am trying to pass the following string to an invoke-command:" icacls C:\ /grant:r BUILTIN\Users:(OI)(CI)(RX)"
I get this error:
The term ‘OI’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
How can i escape the parentheses. I tried it withand \<br><br>Thanks</blockquote>by AlexBrassington at 2013-02-18 00:00:17<blockquote>I think that passing the values in using single quotes will tell PowerShell not to modify the string contents.<br><br>The double quotation mark option is generally the same as the single however when a string is in double quotation marks PowerShell will try to process any variables you've got in there.<br><br><code>#Demonstration of single vs. double quotes<br>$var = "Cake"<br><br>#Double quotes will make PowerShell process the contents of the string<br>Write-Host "I love $var"<br><br>#Single quotes will fail to express your love of cake properly<br>Write-Host 'I love $var'</code></blockquote>by selko at 2013-02-18 02:41:46<blockquote><code>' C:\ /grant:r BUILTIN\Users:(OI)(CI)(RX)'</code><br><br>it still shows up the same error...</blockquote>by selko at 2013-02-18 03:01:15<blockquote>This works:<br><code>' C:\ /grant:r BUILTIN\Users:
(OI)
(CI)
(RX`)'