diff --git a/deploy-bat-files-to-ad2.ps1 b/deploy-bat-files-to-ad2.ps1 new file mode 100644 index 0000000..53348b3 --- /dev/null +++ b/deploy-bat-files-to-ad2.ps1 @@ -0,0 +1,28 @@ +# Deploy DEPLOY.BAT and UPDATE.BAT to AD2 +# Files will be synced to NAS by AD2's Sync-FromNAS.ps1 script + +$Username = "INTRANET\sysadmin" +$Password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force +$Cred = New-Object System.Management.Automation.PSCredential($Username, $Password) + +Write-Host "[INFO] Connecting to AD2..." +New-PSDrive -Name TEMP_AD2 -PSProvider FileSystem -Root "\\192.168.0.6\C$" -Credential $Cred -ErrorAction Stop | Out-Null + +Write-Host "[INFO] Copying DEPLOY.BAT..." +Copy-Item DEPLOY.BAT TEMP_AD2:\Shares\test\ -Force + +Write-Host "[INFO] Copying UPDATE.BAT..." +Copy-Item UPDATE.BAT TEMP_AD2:\Shares\test\ -Force + +Write-Host "[INFO] Verifying line endings..." +$localDeploy = Get-Content DEPLOY.BAT -Raw +$adDeploy = Get-Content TEMP_AD2:\Shares\test\DEPLOY.BAT -Raw + +if ($localDeploy -eq $adDeploy) { + Write-Host "[OK] Files copied successfully with CRLF line endings preserved" +} else { + Write-Host "[WARNING] File content may differ" +} + +Remove-PSDrive TEMP_AD2 +Write-Host "[SUCCESS] Deployment complete. Files will sync to NAS within 15 minutes." diff --git a/directives.md b/directives.md index 6b63ad6..2a5b986 100644 --- a/directives.md +++ b/directives.md @@ -328,6 +328,12 @@ Me: [Proceeds or requests fixes based on validation] - Always use `-ErrorAction` for error handling - Clear status markers in output +### SSH Operations +- **NEVER use Git for Windows SSH for operations** +- Use native OpenSSH (Windows 10+) or PuTTY tools (plink, pscp) +- Git for Windows SSH has compatibility issues with some servers +- Use full path to system SSH: `C:\Windows\System32\OpenSSH\ssh.exe` + ### Security Standards - Never hardcode credentials - Never commit `.env` files