E
E
Evgeny Kotov2020-01-29 16:41:52
PowerShell
Evgeny Kotov, 2020-01-29 16:41:52

How to Syntactically Correctly Execute a PowerShell Script?

How to Syntactically Correctly Execute a PowerShell Script?

Given a folder with projects where each subfolder has its own name.
You need to change the access rights in each subfolder according to the example.
That is, there is a folder with an empty project, all actions are performed on it.

Export to a file with the command:

cd D:\Project
icacls.exe D:\Project\blank\* /save acl /t


And applied to each subfolder with the command:
cd D:\Project
icacls.exe D:\Project\blank\  /restore acl /t /c



Как правильно запустить команду PowerShell такого типа:

dir D:\Project\* -Directory | Select FullName | ForEach-Object { $_.FullName } | icacls { $_.FullName } /restore acl /t /c

Answer the question

In order to leave comments, you need to log in

1 answer(s)
сергей кузьмин, 2020-01-29
@sergueik

Evgeny Kotov,
немного упростил

$d = 'eclipse'; get-childitem -path $d -attributes directory  | foreach-object { $target  = $_.FullName; &  echo icacls $target /restore acl /t /c  }

then echoremove and $ddo= 'D:\Project'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question