Skip to content

Instantly share code, notes, and snippets.

@sei-dupdyke
Created July 15, 2022 19:25
Show Gist options
  • Save sei-dupdyke/1b76d82d32ba922a31b5150833e3ab3f to your computer and use it in GitHub Desktop.
Save sei-dupdyke/1b76d82d32ba922a31b5150833e3ab3f to your computer and use it in GitHub Desktop.
$getPath = $args[0]
if($getpath -eq $null){ write-host "No path provided" exit(1) }
#recursively searches through a path and grabs the data streams
$streams = Get-ChildItem -Path $getPath -Recurse | Get-Item -Stream *
foreach($item in $streams) {
$s = $item.Stream.Trim()
if($s -like "*:$DATA*"){ continue }
#outputs the information to the console
Write-Host "Path: " $item.PSPath -ForegroundColor Green
Write-Host "Parent Path: " $item.PSParentPath -ForegroundColor Yellow
Write-Host "PSChildName: " $item.PSChildName -ForegroundColor Yellow
Write-Host "PSProvider: " $item.PSProvider -ForegroundColor Yellow
Write-Host "PSIsContainer: " $item.PSIsContainer -ForegroundColor Yellow
Write-Host "Filename: " $item.FileName -ForegroundColor Yellow Write-Host "Stream: " $s -ForegroundColor Red
Write-Host "Length: " $item.Length -ForegroundColor Yellow Write-Host "`n"
}
@sei-dupdyke
Copy link
Author

C:> ./get_ads_streams.ps1 C:\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment