Howdy - I found this great function that i need to use but against multiple servers that I have in a list.
how can I modify this to use against several servers in a file?
function RemoteCMD { param( [Parameter(Mandatory=$true,valuefrompipeline=$true)] [string]$compname) begin { $command = [char]34+"powermt display dev=all"+[char]34+" > c:\temp\log.txt" [string]$cmd = "CMD.EXE /C " +$command } process { $newproc = Invoke-WmiMethod -class Win32_process -name Create -ArgumentList ($cmd) -ComputerName $compname | out-null Start-sleep -s 5 $mt=Get-Content \\$compname\C$\temp\log.txt | Out-String Write-Output $mt } End{Write-Output "Script ...END"} }