windows - Powershell pass user input to icacls -


currently writing powershell script automate security measures , have run small problem.

icacls mydirectory /inheritance:r /grant:r 'administrators:f' $mygroup + ':f' 

will fail $mygroup gets tacked onto icacls call , fails add permissions both groups. on windows 7 , context of powershell.

the parser sees $mygroup + ':f' 3 individual arguments. can use either:

"${mygroup}:f" 

or

($mygroup + ':f') 

to provide info parser 1 argument.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -