PowerTip: Use PowerShell 3.0 to Identify Zone Information of Files

PowerTip: Use PowerShell 3.0 to Identify Zone Information of Files

  • Comments 1
  • Likes

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.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • How to do it?

    pseudoCode

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

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