Update StackMonkey.ps1

This commit is contained in:
2025-06-30 00:12:03 -04:00
parent 3afb032791
commit 70aba4acb4

View File

@@ -1378,14 +1378,16 @@ $script
$ext = [IO.Path]::GetExtension($OutputFile).ToLower() $ext = [IO.Path]::GetExtension($OutputFile).ToLower()
if ($ext -eq '.json') { if ($ext -eq '.json') {
# Save the file to the desktop using the full path
$sites | ConvertTo-Json -Depth 3 | Out-File -FilePath $filePath -Encoding UTF8 $sites | ConvertTo-Json -Depth 3 | Out-File -FilePath $filePath -Encoding UTF8
} else { } else {
# Save the file to the desktop using the full path
$sites | Export-Csv -Path $filePath -NoTypeInformation -Encoding UTF8 $sites | Export-Csv -Path $filePath -NoTypeInformation -Encoding UTF8
} }
Write-LogHybrid "Wrote $($sites.Count) sites to $filePath" Success DattoAuth Write-LogHybrid "Wrote $($sites.Count) sites to $filePath" Success DattoAuth
# Open the folder containing the file # Open the folder containing the file
Start-Process explorer.exe /select,"$filePath" Start-Process explorer.exe /select,"$desktopPath"
} else { } else {
# If SaveSitesOnly is not true, just fetch sites (for UI purposes or silent mode without saving) # If SaveSitesOnly is not true, just fetch sites (for UI purposes or silent mode without saving)
Write-LogHybrid "Sites fetched successfully, but not saved." Success DattoAuth Write-LogHybrid "Sites fetched successfully, but not saved." Success DattoAuth