# Check PSCP usage in AD2 sync script

$Username = "INTRANET\sysadmin"
$Password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential($Username, $Password)

Write-Host "[INFO] Checking PSCP usage in Sync-FromNAS.ps1..."

$PSCPLines = Invoke-Command -ComputerName 192.168.0.6 -Credential $Cred -ScriptBlock {
    Get-Content 'C:\Shares\test\scripts\Sync-FromNAS.ps1' | Select-String -Pattern 'pscp|plink' -Context 1
}

Write-Host ""
Write-Host "[INFO] PSCP/PLINK usage found:"
$PSCPLines | ForEach-Object { Write-Host $_ }
