Skip to content

Commit

Permalink
Merge pull request #1523 from OCSInventory-NG/fix-hidden-update-agent
Browse files Browse the repository at this point in the history
Fix hidden update agent teledeploy
  • Loading branch information
Lea9250 committed Jun 27, 2023
2 parents 2ed3cb9 + 7cf7f97 commit fa56edf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/teledeploy/script/scheduledupdateagent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ New-Item -Path "$path" -Name "update.log" -ItemType "file"
Move-Item "$location\ocsupdate.exe" -Destination "$path\ocsupdate.exe"
Move-Item "$location\removeupdateagent.ps1" -Destination "$path\removeupdateagent.ps1"

# Remove hidden attributes
Get-ChildItem "$path\ocsupdate.exe" -Force | ? {$_.mode -match "h"} | foreach {$_.Attributes = [System.IO.FileAttributes]::Normal}
Get-ChildItem "$path\removeupdateagent.ps1" -Force | ? {$_.mode -match "h"} | foreach {$_.Attributes = [System.IO.FileAttributes]::Normal}

Add-Content $logFile -value "UPDATE AGENT LOG FILE"
$date = (Get-date).ToString("dd/MM/yyyy HH:mm")
Add-Content $logFile -value "$date - Starting..."
Expand Down

0 comments on commit fa56edf

Please sign in to comment.