Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls
- $drives = Get-PSDrive -PSProvider 'FileSystem'
- foreach($drive in $drives) {
- if ($drive.DisplayRoot -eq $null)
- {
- Write-Host "Searching local drive $($drive.Root)"
- $files = Get-ChildItem -File -Path $drive.Root -Recurse -Filter WINWORD.exe -ErrorAction SilentlyContinue
- foreach ($file in $files)
- {
- Write-Host " Found Version $($file.VersionInfo.FileVersion) at $($file.VersionInfo.FileName)"
- }
- }
- else
- {
- Write-Host "Skipping network drive $($drive.Root) $($drive.DisplayRoot)"
- }
- }
Add Comment
Please, Sign In to add comment