$port= new-Object System.IO.Ports.SerialPort COM7,19200,None,8,one
$port.open()
$port.WriteLine("?p")
$port.ReadLine()
$MachinePower= $port.ReadLine()
$date = Get-Date
$TextTOsend = "MachineName,"+ $date +"," +$MachinePower
$TextTOsend | Out-File output.csv -Append -Encoding ASCII
$port.Close()
远程运行时,使用此
psexec \\RemotePC -s -u username -p password powershell C:\ReadFAMLaser\ReadPower.ps1
output.csv没有输出 我错过了什么吗?