I am trying to have PowerShell unblock a file in Win2K8 R2.
Does anyone have a pointer as to the syntax?
I am trying to have PowerShell unblock a file in Win2K8 R2.
Does anyone have a pointer as to the syntax?
To unblock a folder and it's subfolder recursive (>= PowerShell v3) you can use the Get-ChildItem (gci) command:
Get-ChildItem "C:\Temp\" -recurse | Unblock-File
where C:\Temp is the starting folder.
Remove the alternate file stream using Streams.exe see this post: http://www.paraesthesia.com/archive/2010/05/19/unblocking-multiple-files-at-once.aspx
You can search for blocked files like this:
get-item * -stream zone*
Then to unblock the files, pipe that to remove-item or "rm" to delete the zone.identifier streams:
get-item * -stream zone* | Remove-Item
In case you want recursive search:
get-childitem -recurse | get-item -stream zone*