SOP-001: Windows Systems Optimization & PowerShell 7 Lifecycle
| Field | Detail |
|---|---|
| Document ID | SOP-001 |
| Version | 1.0 |
| Date | March 2026 |
| Author | Gemi (Gemini — Atlantis AI) |
| Reviewed By | Shane Hardin |
| Applies To | All Atlantis OS Windows workstations |
| Difficulty | Intermediate |
| Est. Time | 30–60 minutes (full run) |
| Related Docs | KB-001 — M365 Copilot Limitations, HT-001 — Cloudflare Connector Rebuild |
1. Overview
This SOP covers two repeatable operational procedures for all Atlantis OS Windows workstations:
- C: Drive Triage — emergency space reclamation when the OS drive falls below 10GB free
- PowerShell 7 Upgrade — installing and configuring PowerShell 7.x (Core) side-by-side with the legacy 5.1 engine
Both procedures are relevant to the AtlantisITS infrastructure stack. PowerShell 7 is required for modern JSON handling, n8n webhook scripting, and any future Linux VPS automation work.
⚠️ NOTE: Always maintain at least 20GB free on C: to allow for .NET Core updates and log rotation from AtlantisITS automation tools.
2. When to Run This SOP
Run Section 3 (C: Drive Triage) when:
- C: drive falls below 10GB free space
- Windows performance degrades noticeably (slow boot, slow file operations)
- After a major Windows Update cycle
Run Section 4 (PowerShell 7 Upgrade) when:
- Setting up a new Atlantis OS workstation
- Scripts using
ConvertFrom-Json, parallel processing, or SSH remoting are needed - Migrating n8n or automation scripts to a Linux VPS
3. C: Drive Triage — The "10GB Rescue" Plan
When a system falls below 10GB free, Windows performance degrades due to Page File and Cache constraints. Run these steps in order.
⚠️ NOTE: All commands in this section require an Admin terminal. Right-click PowerShell or Command Prompt → Run as Administrator.
Step 1 — Deep Clean Windows Update Files
Standard Disk Cleanup ignores superseded update files. This command forces a deep clean of the Windows image component store.
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
Expected result: Reclaims 2GB–10GB of old Windows Update junk. This may take 5–15 minutes.
⚠️ NOTE: The
/ResetBaseflag is permanent — it removes the ability to uninstall currently installed updates. Only run this when space is critical.
Step 2 — Manage the Hibernation File
If the system has 32GB+ RAM, the hibernation file (hiberfil.sys) consumes a massive amount of space (roughly 75% of total RAM).
Option A — Disable hibernation entirely (reclaims the most space):
powercfg -h off
Option B — Shrink hibernation file (keeps Fast Startup, halves file size):
powercfg /h /type reduced
💡 TIP: For a workstation that stays powered on (like the Atlantis build machine), Option A is safe. For a laptop you put to sleep, use Option B.
Step 3 — Purge Temporary Folders
Clear both the user and system temp directories. Run each path in File Explorer or use PowerShell:
# Clear user temp
Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
# Clear system temp
Remove-Item "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue
💡 TIP: Use WizTree (not WinDirStat) to find hidden bloat in seconds. WizTree reads the MFT directly and is dramatically faster on large drives.
Step 4 — Find the Biggest Files on C:
Run this PowerShell 7 command to identify the top 10 largest files consuming space:
Get-ChildItem -Path C:\Users\shane\Downloads -File |
Sort-Object Length -Descending |
Select-Object Name, @{Name="Size(GB)";Expression={$_.Length / 1GB}} -First 10
Move any large installers, ISOs, or zip files to D:\ or E:\ storage.
Step 5 — Automate Future Cleanup with the Atlantis Archiver
To prevent C: drive bloat from recurring, deploy the AtlantisITS Archive Script. This script automatically moves files older than 30 days from Downloads to the Toshiba E: drive.
Create the script file:
Save the following as Archive-Downloads.ps1 in your scripts folder:
# AtlantisITS AI — Automated Download Archiver
# Moves files older than 30 days from Downloads to E: archive
$Source = "$env:USERPROFILE\Downloads"
$Destination = "E:\Data\AtlantisITS\Archive\Downloads"
$DaysOld = 30
$LogFile = "E:\Data\AtlantisITS\logs\archiver-log.txt"
# Create destination if it doesn't exist
if (-not (Test-Path $Destination)) {
New-Item -ItemType Directory -Path $Destination -Force | Out-Null
}
# Get files older than threshold — files only, not folders
$OldFiles = Get-ChildItem -Path $Source -File |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-$DaysOld) }
foreach ($File in $OldFiles) {
try {
Move-Item -Path $File.FullName -Destination $Destination -ErrorAction Stop
$LogEntry = "$(Get-Date -Format 'yyyy-MM-dd HH:mm') | MOVED | $($File.Name)"
} catch {
$LogEntry = "$(Get-Date -Format 'yyyy-MM-dd HH:mm') | ERROR | $($File.Name) | $($_.Exception.Message)"
}
Add-Content -Path $LogFile -Value $LogEntry
}
Write-Host "Archive complete. $($OldFiles.Count) files processed." -ForegroundColor Green
Why this is safe:
- Moves files only — no folders, so no specialized software paths are broken
- Keeps C: SSD lean for AI models and OS performance
- Uses
pwsh.exeto ensure the PS7 engine is used - Logs every move for auditability
Schedule it with Task Scheduler (Set and Forget):
- Open Task Scheduler
- Click Create Basic Task → Name it
Atlantis-Archiver - Set trigger to Weekly or Monthly
- For Action, choose Start a Program with these settings:
| Field | Value |
|---|---|
| Program/script | pwsh.exe |
| Add arguments | -File "D:\Data\AtlantisITS\scripts\Archive-Downloads.ps1" |
- Click Finish → confirm the task appears in Task Scheduler Library
4. PowerShell 7 Upgrade Path
PowerShell 7 does not replace 5.1 — they run side-by-side. Windows system tasks that rely on 5.1 will not break.
Step 1 — Check Current Version
Run this in any terminal to confirm what version is active:
$PSVersionTable
Reading the output:
| Version | Edition | Terminal Background | Description |
|---|---|---|---|
| 5.1.x | Desktop | Blue (default) | Legacy engine. Reliable but no longer in active development. |
| 7.x.x | Core | Black (default) | Modern, cross-platform engine. Required for n8n scripting and SSH remoting. |
Step 2 — Install PowerShell 7 (Winget Method)
This is the cleanest install path — automatically registers the PATH correctly.
- Open PowerShell 5.1 as Administrator
- Run:
winget install --id Microsoft.PowerShell --source winget
- Wait for install to complete — no reboot required
Step 3 — Verify the Install
Open a new terminal and run:
pwsh
$PSVersionTable
Confirm PSVersion shows 7.x.x and PSEdition shows Core.
Step 4 — Set PS7 as Default in Windows Terminal
For an Enterprise Architect workflow, set PS7 as the default shell:
- Open Windows Terminal
- Go to Settings → Startup
- Set Default Profile to
PowerShell(the black/dark blue icon — not Windows PowerShell which is blue) - Click Save
💡 TIP: To quickly distinguish:
pwsh= PowerShell 7 (Core, black).powershell= PowerShell 5.1 (Legacy, blue). Both remain available at all times.
5. PowerShell 7 Key Features for AtlantisITS
5.1 Parallel Processing
The biggest upgrade for infrastructure work. In PS 5.1, tasks ran sequentially. PS 7 runs them in parallel across all CPU cores.
# Scan 100 endpoints simultaneously instead of one by one
$Servers | ForEach-Object -Parallel {
Test-Connection -ComputerName $_ -Count 1
} -ThrottleLimit 20
Result: Network scans and log checks run 5x–10x faster.
5.2 New Operators for Cleaner Scripts
# Ternary operator (one-line if-else)
$Status = ($Service.Running) ? "Online" : "Offline"
# Pipeline chain — only run next command if previous succeeded
Write-Output "Backup started" && Start-Service Atlantis-Archiver
# Or — only run next command if previous failed
Start-Service n8n || Write-Error "n8n failed to start"
5.3 Native JSON Improvements
Critical for n8n webhook scripting. PS 7's ConvertFrom-Json is significantly faster, supports JSONC (JSON with comments), and preserves property order — which PS 5.1 would often scramble.
# PS 7 — fast, order-preserved, JSONC supported
$Payload = Get-Content webhook-payload.json | ConvertFrom-Json
5.4 SSH-Based Remoting
PS 5.1 relied on WinRM, which is painful to configure through firewalls. PS 7 supports SSH remoting on standard Port 22.
# Remote into a Linux VPS using SSH — no WinRM config needed
Enter-PSSession -HostName vps.atlantisits.co -UserName shane -SSHTransport
5.5 Cross-Platform Compatibility
PS 7 scripts run on Windows, Linux, and macOS with the same syntax. When AtlantisITS automation moves to a Linode VPS, scripts migrate with near-zero modification.
6. Feature Comparison At-a-Glance
| Feature | PowerShell 5.1 (Legacy) | PowerShell 7.x (Core) |
|---|---|---|
| Engine | .NET Framework 4.5 | .NET 7 / 8 |
| Performance | Standard | High (multi-core optimized) |
| JSON Support | Basic / order scrambled | Advanced / fast / JSONC |
| Cross-Platform | Windows only | Windows, Linux, macOS |
| Remoting | WinRM (HTTP/HTTPS) | WinRM + SSH |
| Parallel Processing | Not native | Native (-Parallel flag) |
| Ternary / Chain Operators | ❌ No | ✅ Yes |
| Required for AtlantisITS | ⚠️ Legacy scripts only | ✅ All new automation |
7. Troubleshooting
| Error / Symptom | Cause | Fix |
|---|---|---|
winget not found |
WinGet not installed on older Windows 10 builds | Install App Installer from Microsoft Store or use MSI installer from GitHub |
pwsh opens PS 5.1 |
PATH not updated after install | Close and reopen terminal — or run $env:PATH to confirm PS7 path registered |
| DISM command hangs | Large component store or slow drive | Let it run — can take 15–30 min on HDDs. Do not interrupt. |
| Archive script skips files | Files in use or locked | Script uses -ErrorAction SilentlyContinue — check log file for skipped entries |
| Task Scheduler task not running | Wrong executable path or PS version | Confirm pwsh.exe path: run (Get-Command pwsh).Source in a PS7 terminal |
ConvertFrom-Json errors on PS 5.1 |
PS 5.1 JSON parser limitations | Switch to PS7 — run script with pwsh.exe instead of powershell.exe |
8. Quick Reference
| Item | Value |
|---|---|
| Check PS version | $PSVersionTable |
| Launch PS7 | pwsh |
| Launch PS5.1 | powershell |
| Install PS7 | winget install --id Microsoft.PowerShell --source winget |
| DISM deep clean | Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase |
| Disable hibernation | powercfg -h off |
| Shrink hibernation | powercfg /h /type reduced |
| Archive script path | D:\Data\AtlantisITS\scripts\Archive-Downloads.ps1 |
| Task Scheduler program | pwsh.exe |
| Task Scheduler argument | -File "D:\Data\AtlantisITS\scripts\Archive-Downloads.ps1" |
| WizTree | Preferred disk analysis tool — reads MFT directly |
Document prepared by Gemi (Gemini — Atlantis AI Automations)
atlantisits.info | SOP-001 | v1.0 | March 2026