This scripts was working normal, and suddenly it is not working, can someone please tell,
same issue is with my all scripts all sudden all showing same error,
$computers = Get-Content -Path E:\Newfolder\Input\List_computers.txt
$password = convertTo-SecureString "123456" -AsPlainText -Force$cred = New-Object System.Management.Automation.PSCredential ("user", $password)$session = New-PSSession -ComputerName $computers -Credential $cred$command = {Get-LocalUser| where-Object -Property Enabled -EQ True | Select-Object -Property Name, Enabled, Description }$res = Invoke-Command -Session $session -ScriptBlock $command | Export-Csv \10.1.1.1\e$\usercheckResult.csv -NoTypeInformation | Start-Sleep -Seconds 5 | Exit-PSSession
ERROR message
New-PSSession : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At E:\Newfolder\runningForUser_IP.ps1:4 char:40+ $session = New-PSSession -ComputerName $computers -Credential $cred+ ~~~~~~~~~~+ CategoryInfo : InvalidData: (:) [New-PSSession], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.NewPSSessionCommandInvoke-Command : Cannot validate argument on parameter 'Session'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.At E:\Newfolder\runningForUser_IP.ps1:6 char:32+ $res = Invoke-Command -Session $session -ScriptBlock $command | Expor ...+ ~~~~~~~~+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand