Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-Content c:computers.txt | `
- Select-Object @{Name='ComputerName';Expression={$_}},@{Name='FolderExist';Expression={ Test-Path "\$_c$program files (x86)thefolder"}}
- Get-Content .computers.txt |
- Select-Object @{Name='ComputerName';Expression={$_}},
- @{Name='Online';Expression={(Test-Connection $_ -count 1 -EA 0).StatusCode -eq 0}},
- @{Name='FolderExist';Expression={ Test-Path "\$_c`$program files (x86)common files"}}
- ComputerName Online FolderExist
- ------------ ------ -----------
- Computer01 True True
- Computer02 False False
- Computer03 True False
- Get-Content .computers.txt |
- Select-Object @{n='ComputerName';e={$_}},
- @{n='FolderExist';e={ If(Test-Connection $_ -Quiet -Count1){Test-Path "\$_c`$program files (x86)common files"}else{"Offline"}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement