So I tries calling the following code with and without credentials.
$username = "user"
$password = "password"
$cred = new-object -argumentlist $username, $password
#Invoke-Command -ComputerName computer -FilePath "C:SomePath.ps1" -Credential $cred
Invoke-Command -ComputerName localhost -FilePath "C:SomePath.ps1"
after calling in cmd appeared the following lines:
cmdlet New-Object at command pipeline position 1
Supply values for the following parameters:
TypeName:
I have abs no idea what it means. Can somebody help me please?