![Page 1: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/1.jpg)
PowerShell во имя добраКУЛАКОВ АНАТОЛИЙ
![Page 2: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/2.jpg)
WSH
VBS
Cygwin
![Page 3: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/3.jpg)
![Page 4: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/4.jpg)
![Page 5: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/5.jpg)
Get-ChildItem -Path "$sourceDir" -Filter "*.cs" -Recurse |
Where-Object -FilterScript { -not $PSItem.IsReadOnly } |
Sort-Object -Property FullName |
Select-Object –Property @{ Name = "RelativePath"; Expression = { Resolve-Path $PSItem.FullName -Relative } }, FullName |
ForEach-Object –Process { $PSItem.RelativePath; Set-ItemProperty -Path $PSItem.FullName -Name IsReadOnly -Value $false } |
Set-Content -Path (Join-Path -Path $sourceDir -ChildPath "log.txt")
![Page 6: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/6.jpg)
ls $sourceDir *.cs -r |? {-not $_.IsReadOnly} |sort FullName |select @{N="Rel";E={rvpa $_.FullName -r}}, FullName |% {$_.Rel;sp $_.FullName IsReadOnly $false} |sc (join-path $sourceDir "log.txt")
![Page 7: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/7.jpg)
ls "$sourceDir" -Filter "*.cs" -Recurse |
where { -not $_.IsReadOnly } |
sort FullName |
select @{ Name = "RelativePath"; Expression = { Resolve-Path $_.FullName -Relative } }, FullName |
foreach { $_.RelativePath; Set-ItemProperty $_.FullName IsReadOnly $false } |
Set-Content (Join-Path $sourceDir "log.txt")
![Page 8: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/8.jpg)
Диски
•Alias•FileSystem•Certificate•Environment•Function•Variable•Registry
• WSMan• GithubFS• Dropbox• MSSQL• FTP• E-Mail• Active Directory• ...
![Page 9: Анатолий Кулаков «Windows PowerShell во имя добра»](https://reader034.vdocuments.site/reader034/viewer/2022050800/589ff5a01a28ab46598b56d7/html5/thumbnails/9.jpg)
ЧТО ЕЩЁ?