Advertisement
alice_killer

path test waz

Jun 7th, 2023 (edited)
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Source = '\\SOMESERVER\shares\A\Wazuh\wazuh-agent-4.4.0-1.msi'
  2. $Destination = 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'
  3.  
  4. if (Test-Path -Path $Source) {
  5.     Write-Output "Всё хороно, начинаю установку."
  6.     Start-Sleep  -Seconds 10
  7.     Copy-Item -Path $Source -Destination $Destination -Force; msiexec.exe /i 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi' /q WAZUH_MANAGER='192.168.0.88' WAZUH_REGISTRATION_SERVER='192.168.0.88' WAZUH_AGENT_GROUP='Cert'
  8.     Start-Sleep  -Seconds 30
  9.     Write-Host "Downloaded and installed"
  10.     Start-Sleep  -Seconds 3
  11.     Write-Host "Restarting Wazuh service..."
  12.     Start-Sleep  -Seconds 3
  13.     Restart-Service WazuhSvc
  14.     Start-Sleep  -Seconds 30
  15.     Remove-Item 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'
  16.     Start-Sleep  -Seconds 5
  17.     Write-Host "The installation is successfully completed"
  18. } else {
  19.     Write-Output "В указанной директории нет данного файла. Установка не возможна!"
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement