Continue

Continue

Appendix: Batch Scorecards

Ultimate PowerShell
Level-up Guide

Appendix: Batch Scorecards

Windows Batch Script Complexity Scorecard

Score points for any/all that apply.POINT VALUEYOUR POINTS
Basic Windows Batch commands:
Uses ERRORLEVEL+1 
Uses variables/SET commands+1 
Uses loops/FOR command+1 
Uses commands you’ve never seen+3 
Uses clever hacks/tricks+5 
Well-commented/Well-documented-2 
YOUR TOTAL
(You’ll use this total on the last scorecard.)

Windows Batch Script Length Scorecard

Score only the most descriptive choice.POINT VALUEYOUR POINTS
Under 10 lines+1 
10 to 49 lines+2 
50 to 99 lines+5 
100 to 199 lines+10 
200 to 499 lines+50 
500 to 9999 lines+100 
1000 or more lines*+ ∞+ ∞
YOUR TOTAL
(You’ll use this total on the last scorecard.)
* Really?! That’s… a Batch-based application. Someone must really have forsaken the Ancient Gods of Batch. There are some scripts that should never be touched. This is one of them.

Windows Batch Script Impact Scorecard

Score only the most descriptive choice.POINT VALUEYOUR POINTS
Miniscule (no impact on end-users, impacts only you/your team)+10 
Minor (minor business operations impact and/or has an easy workaround to avoid minor security risks)+20 
Major (moderate business operations impact and/or security risk)+30 
Critical (serious business operations impact and/or security risk)+40 
Super-critical/Blocker (a major malfunction that affects business operations or risks to security)+50 
YOUR TOTAL
(You’ll use this total on the last scorecard.)

Interpret Your Batch Migration Difficulty Score

ScoreShould You Migrate?
0Migrate Today: A Batch script that doesn’t use Batch commands is always convertible to PowerShell by just changing the .cmd/ .bat to a .ps1 ending, regardless of length or impact. Renaming should do it!
1 to 10Rewrite as Needed: Carefully rewriting the script from Batch to PowerShell should work, and there’s no need to rush the process.
11 to 550⚠️Consult with Experts: These may be trickier than they seem, so make sure to have a Windows Batch and/or PowerShell expert available to evaluate and review the scripts before and after they’re migrated.
551 to 5,500⚠️For Experts Only: Only Windows Batch and PowerShell scripting experts should evaluate these scripts to consider if they should even be PowerShell scripts at all, or dedicated applications, and how to migrate.
Over 5,550🚫Do Not Migrate: The Windows Batch scripts in these cases are so complex, lengthy, and/or have such risk of heavy impact that their entire purpose needs to be reevaluated, and reconsidered from the ground-up.