Chapters/tool-design/snippets.ps1

# example - this will not execute
Get-Content computernames.txt | Test-PCConnection | Get-Whatever



# examples - will not execute
Get-Content names.txt | Set-MachineStatus
Get-ADComputer -filter * | Select -Expand Name | Set-MachineStatus
Get-ADComputer -filter * | Set-MachineStatus
Set-MachineStatus -ComputerName (Get-Content names.txt)



# design - these will not execute
Get-MachineInfo -ComputerName CLIENT

Get-MachineInfo -ComputerName CLIENTA,CLIENTB
Get-MachineInfo -ComputerName (Get-Content names.txt)
Get-MachineInfo -ComputerName (Get-ADComputer -id CLIENTA | 
Select -Expand name)

Get-Content names.txt | Get-MachineInfo
Get-ADComputer -id CLIENTA | Select -Expand name | Get-MachineInfo



# example - will not execute
Get-MachineInfo -ComputerName ONE,TWO,BUCKLE,SHOE -LogFailuresToPath `
errorlog.txt



# example - will not execute
Get-MachineInfo -ComputerName PC1,PC2 -Protocol WMI -ProtocolFallback