PowerTip: Use PowerShell 3.0 to Identify Zone Information of Files

Summary: Learn how to use Windows PowerShell 3.0 to identify the zone information of files in a folder.

Hey, Scripting Guy! Question  How can I use Windows PowerShell 3.0 to see which files in a folder have a Zone.Identifier alternate data stream so I can find files that came from the Internet?

Hey, Scripting Guy! Answer Use the Get-Item cmdlet, specify the path for the files, and specify the Zone.Identifier name for the Stream parameter:

 Get-Item c:\fso\* -Stream zone*

Note   The –Stream parameter accepts wildcard characters, so you do not have to type the entire Zone.Identifier string.

Comments (1)

  1. pregunton says:

    How to do it?


    $fileIsBlock = (Get-Item c:fso* -Stream zone* -eq "BLOCKED");

    if ($fileIsBlock)
    Unblock-File -Path FileBlockTestToUnblock.docx #-WhatIf

Skip to main content