Fixing $credentials not set bug in invoke-remote cmdlet