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
- 41 Getting started
- 25 Read before posting
- 8 Meet and greet
- 237 General
- 64 News and announcements
- 1 Swag
- 1 Roadmap updates
- 79 Resources
- 12 Knowledge Base
- 16 Webinars
- 1 Shared Script Library
- 2 Blog
- 19 Pro Tips
- 27 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 140 Remote Monitoring and Management
- 84 Remote Monitoring
- 27 Patch Management
- 105 Professional Services Automation
- 64 Helpdesk
- 17 Billing
- 21 Reporting
- 36 Integrations & add-ons
- 20 Integrations
- 10 Add-ons
- 103 Scripting and automations
- 61 Scripts
- 30 Automations