$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password) Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock { Get-ChildItem C:\Shares\test -Recurse -Filter '*menux*.bas' -ErrorAction SilentlyContinue | Select-Object FullName, LastWriteTime, Length }