Add User Name and Password in the Powershell command
I have this command below that access a file on a computer named windows7 and replaces a string username with white.
it works when the remote Windows7 computer is logged on with the same username and password I am logged on to this computer I am running Powershell command from.
However now the remote computer is logged on with username: JDock and Password : Passw0rd
how do I include the username and password inside the powershell command ?
((Get-Content -path '\\windows7\c$\test.txt' -Raw) -replace ' username', 'white') | Set-Content -Path '\\windows7\C$\test.txt'