Successful Script deployment but Atera shows failed - No output
Basically the title - I made a PS script and ran it from Atera on a machine which I had next to me physically. The script worked and it did what it was supposed to, but the Atera console showed no output and said the deployment failed. Not sure why, any help would be appreciated!
Comments
-
I think this happens if it either times out, or if you don't have an output on the script. Can you supply the script at all? just so i can help?
1 -
@AlexYoungNSM Here is the script - The script panel window did say timed out after a while, so that might be it.
Run script as AdminStart-Process PowerShell -verb runas -ArgumentList '-noexit','-File','RemoveBloatFiles.ps1'
Empty Recycling binWrite-Host "Emptying Recyle Bin" -ForegroundColor Yellow
Delete Temp files in various locations
$Path = 'C' + ':$Recycle.Bin'
Get-ChildItem $Path -Force -Recurse -ErrorAction SilentlyContinue | Remove-Item -Recurse -Exclude *.ini -ErrorAction SilentlyContinue
Write-Host "All the necessary data removed from recycle bin successfully" -ForegroundColor GreenWrite-Host "Erasing temporary files from various locations" -ForegroundColor Yellow
Clean disk using Disk Cleanmgr
$Path1 = 'C' + ':\Windows\Temp'
Get-ChildItem $Path1 -Force -Recurse -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
$Path2 = 'C' + ':\Windows\Prefetch'
Get-ChildItem $Path2 -Force -Recurse -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
$Path3 = 'C' + ':\Users\User\AppData\Local\Temp'
Get-ChildItem $Path3 -Force -Recurse -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "Removed all the temp files successfully" -ForegroundColor GreenWrite-Host "Using disk cleaup tool" -ForegroundColor Yellow
Run an SFC scannow to remove corrupt files
Cleanmgr /sagerun:1 | out-Null
Write-Host "Disk cleanup successfully done" -ForegroundColor Green
Start-Sleep -seconds 5Write-Host "Running SFC Scan to fix corrupt files" -ForegroundColor Yellow
Restart Computer
Start-Process -FilePath "sfc.exe" -Verb RunAs -ArgumentList "/scannow" -Wait
Write-Host "SFC Scan Completed Successfully" -ForegroundColor Green
Start-Sleep -Seconds 5Restart-Computer
1
Topics
- All Topics
- 42 Getting started
- 26 Read before posting
- 8 Meet and greet
- 257 General
- 71 News and announcements
- 2 Swag
- 1 Roadmap updates
- 83 Resources
- 12 Knowledge Base
- 17 Webinars
- 1 Shared Script Library
- 2 Blog
- 21 Pro Tips
- 28 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 142 Remote Monitoring and Management
- 85 Remote Monitoring
- 28 Patch Management
- 107 Professional Services Automation
- 65 Helpdesk
- 17 Billing
- 22 Reporting
- 41 Integrations & add-ons
- 22 Integrations
- 11 Add-ons
- 108 Scripting and automations
- 62 Scripts
- 32 Automations