Курс: Апгрейд навыков до MCSA Windows Server 2012

Write-Host "Found $($blockedFiles.Count) blocked files" -ForegroundColor Cyan

param( [Parameter(Mandatory=$false)] [string]$Path = ".", [Parameter(Mandatory=$false)] [switch]$WhatIf,

Get-Content -Path "downloaded.exe" -Stream Zone.Identifier Sample output:

Usage:

.\Unblock-Tree.ps1 -Path "C:\MyFolder" -WhatIf # Preview only .\Unblock-Tree.ps1 -Path "C:\MyFolder" -Confirm # With confirmation The command Get-ChildItem -Recurse -File | Unblock-File is powerful but should be used carefully. Always preview blocked files first, understand where they came from, and only unblock files you completely trust. For daily use with your own scripts or trusted projects, it's a safe time-saver that eliminates the need to manually unblock hundreds of files.

foreach ($file in $files) $hasZone = Get-Item $file.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue if ($hasZone) $blockedFiles += $file

Get-childitem -recurse -file | Unblock-file Today

Write-Host "Found $($blockedFiles.Count) blocked files" -ForegroundColor Cyan

param( [Parameter(Mandatory=$false)] [string]$Path = ".", [Parameter(Mandatory=$false)] [switch]$WhatIf, get-childitem -recurse -file | unblock-file

Get-Content -Path "downloaded.exe" -Stream Zone.Identifier Sample output: Write-Host "Found $($blockedFiles

Usage:

.\Unblock-Tree.ps1 -Path "C:\MyFolder" -WhatIf # Preview only .\Unblock-Tree.ps1 -Path "C:\MyFolder" -Confirm # With confirmation The command Get-ChildItem -Recurse -File | Unblock-File is powerful but should be used carefully. Always preview blocked files first, understand where they came from, and only unblock files you completely trust. For daily use with your own scripts or trusted projects, it's a safe time-saver that eliminates the need to manually unblock hundreds of files. understand where they came from

foreach ($file in $files) $hasZone = Get-Item $file.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue if ($hasZone) $blockedFiles += $file