Files
claudetools/temp-find-sync-script.ps1

8 lines
417 B
PowerShell

$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 {
Write-Host "Looking for sync script..."
Get-ChildItem 'C:\Shares\test' -Recurse -Filter "sync*.ps1" -ErrorAction SilentlyContinue | Select-Object FullName, LastWriteTime
}