Date: 2025-10-02 Total Scripts: 772 Scripts Reviewed (Sample): 42 Review Status: In Progress - ~85% Complete
A comprehensive quality review of 42 representative scripts from 772 total PowerShell scripts reveals significant quality issues affecting approximately 65-70% of scripts. The most critical issue is widespread incorrect [string] type casting on object variables, which causes runtime failures. Immediate remediation recommended for critical issues before production deployment.
Impact: 24+ scripts affected (estimated ~30% of total repository) Severity: CRITICAL - Causes runtime failures
Problem: Variables containing objects, hashtables, and collections are being cast as [string], which prevents access to object properties and methods.
Examples:
# INCORRECT
[string]$VirtualMachine = New-AzVMConfig @params
[string]$ResourceGroup = New-AzResourceGroup @params
[string]$context = Get-AzContext
# CORRECT
$VirtualMachine = New-AzVMConfig @params
$ResourceGroup = New-AzResourceGroup @params
$context = Get-AzContextAffected Files:
scripts/ai/Azure-AI-Services-Manager.ps1scripts/compute/Get Azvmsize.ps1scripts/compute/New Azvmautoshutdown.ps1scripts/compute/New Azvm Linux.ps1(50+ instances)scripts/compute/New Azvm Windows Server Existing VNet Workgroup.ps1scripts/devops/Azure-DevOps-Pipeline-Manager.ps1scripts/cost/scripts/automation/Setup-BudgetAlerts.ps1- And approximately 17+ more scripts
Action Required: Remove ALL incorrect [string] type casts from object variables
Impact: 12 scripts affected Severity: HIGH - Causes syntax errors
Problem: Missing closing #> tags and malformed help blocks with embedded backtick-n
Examples:
# INCORRECT
<#`n.SYNOPSIS
Script description
[CmdletBinding()] # Missing closing #>
# CORRECT
<#
.SYNOPSIS
Script description
#>
[CmdletBinding()]Affected Files:
scripts/ai/Azure-AI-Services-Manager.ps1scripts/backup/Azure-Backup-Manager.ps1scripts/network/Get Aznetworksecuritygroup.ps1scripts/network/New Azbastion.ps1scripts/devops/Azure-DevOps-Pipeline-Manager.ps1scripts/utilities/Killall Azresourcegroup.ps1scripts/identity/Disable-User.ps1scripts/utilities/Remove Recoveryservicesvaults Updated.ps1- And approximately 4+ more scripts
Action Required: Add missing #> tags and remove backtick-n from help blocks
Impact: 3+ scripts affected Severity: CRITICAL - Security risk and prevents reusability
Problem: Scripts contain hardcoded customer names, subscription IDs, tenant IDs, and personal information
Affected Files:
scripts/utilities/Define Param.ps1- Hardcoded: "CanadaComputing", "Abdullah Ollivierre"
scripts/network/New Azbastion.ps1- Hardcoded: "FGCHealth", subscription ID, tenant ID, "Abdullah Ollivierre"
scripts/network/Get Aznetworksecuritygroup.ps1- Hardcoded: "FAX1_GROUP"
Action Required: Remove ALL hardcoded values and replace with parameters
Impact: 15+ scripts affected Severity: HIGH - Syntax errors
Problem: Scripts have thrown}instead of properthrow` followed by newline and closing brace
Example:
# INCORRECT
} catch {
Write-Error $_.Exception.Message
throw`n}
# CORRECT
} catch {
Write-Error $_.Exception.Message
throw
}Affected Files:
scripts/ai/Azure-AI-Services-Manager.ps1scripts/compute/Get Azvmsize.ps1scripts/compute/New Azvmautoshutdown.ps1scripts/compute/New Azvm Linux.ps1scripts/compute/Azure AKS Cluster Provisioning Tool.ps1- And approximately 10+ more scripts
Action Required: Fix all malformed throw statements
Impact: 8 scripts affected Severity: MEDIUM
Problem: [CmdletBinding()] must appear BEFORE param() block, not after or inside
Affected Files:
scripts/storage/Azure-Storage-Keys-Retriever.ps1scripts/utilities/Define Param.ps1scripts/utilities/Remove Recoveryservicesvaults Updated.ps1- And approximately 5+ more scripts
Impact: 8 scripts affected Severity: MEDIUM
Affected Files:
scripts/utilities/Select Azsubscription.ps1scripts/network/Get Aznetworksecuritygroup.ps1scripts/network/New Azbastion.ps1- And approximately 5+ more scripts
Impact: 9 scripts affected Severity: HIGH - Scripts cannot execute
Affected Files:
scripts/storage/Azure-Storage-Keys-Retriever.ps1(Critical structure issues)scripts/utilities/Killall Azresourcegroup.ps1(Missing closing braces)scripts/utilities/Remove Recoveryservicesvaults Updated.ps1(Multiple syntax errors, function namedWrite-Host)scripts/utilities/Define Param.ps1(Missing closing brace)scripts/cost/scripts/automation/Setup-BudgetAlerts.ps1(Undefined variables)- And approximately 4+ more scripts
Impact: 6 scripts affected Severity: LOW
Problem: Excessive/redundant throw statements, unreachable code after throw
Impact: 3 scripts affected Severity: LOW
Problem: Scripts missing required module declarations
The following scripts demonstrated good quality with proper structure, help documentation, and minimal issues:
✅ scripts/backup/Azure-Backup-Manager.ps1
✅ scripts/identity/Azure Role Assignment Manager.ps1
✅ scripts/monitoring/Azure Resource Health Checker.ps1
✅ scripts/utilities/Select Azsubscription.ps1
✅ scripts/utilities/Automated Iaas Backup.ps1
✅ scripts/utilities/Asr Wordpress Changemysqlconfig.ps1
Assigned Count: 258 scripts
Directories:
scripts/ai/- All scripts (1)scripts/backup/- All scripts (1)scripts/compute/- All scripts (~105)scripts/cost/- All scripts (~20)scripts/devops/- All scripts (~25)scripts/identity/- All scripts (~85)scripts/integration/- All scripts (1)scripts/iot/- All scripts (1)scripts/migration/- All scripts (1)scripts/monitoring/- First 18 scripts
Assigned Count: 258 scripts
Directories:
scripts/monitoring/- Remaining scripts (from script 19 onwards, ~37 total)scripts/network/- All scripts (~125)scripts/security/- All scripts (~45)scripts/storage/- First 51 scripts
Assigned Count: 256 scripts
Directories:
scripts/storage/- Remaining scripts (from script 52 onwards, ~84 total)scripts/utilities/- All scripts (~172)
When reviewing/fixing your assigned scripts, check for:
- Remove ALL
[string]type casts on object variables - Fix malformed help blocks (missing
#>, embedded backtick-n) - Remove ALL hardcoded customer/subscription values → parameterize
- Fix malformed closing braces (
thrown}` → proper syntax) - Ensure
[CmdletBinding()]comes BEFOREparam()block - Add
[CmdletBinding()]if missing - Fix broken syntax and incomplete code blocks
- Verify proper error handling (try/catch/finally)
- Add
#Requiresstatements for module dependencies - Test script execution after fixes
-
Phase 1 (Week 1): Fix ALL critical issues
- [string] type casting
- Hardcoded values
- Malformed help blocks
- Broken syntax
-
Phase 2 (Week 2): Fix moderate priority issues
- [CmdletBinding()] placement
- Missing [CmdletBinding()]
- Error handling improvements
-
Phase 3 (Week 3): Quality improvements
- Add missing #Requires
- Standardize documentation
- Add comprehensive examples
- Code review and testing
Status: 65-70% of sampled scripts have quality issues ranging from minor to critical
Most Pervasive Issue: Incorrect [string] type casting (~30% of repository)
Immediate Action: Fix critical issues before any production deployment
Estimated Effort: 3-4 weeks with 3 team members working in parallel
For questions about this review or script assignments:
- Repository Owner: Wes Ellis (wes@wesellis.com)
- Review Date: 2025-10-02
- Review Tool: Claude Code AI Assistant
End of Quality Review Report