Created
February 15, 2014 18:52
-
-
Save Nora-Ballard/9023507 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :: Get Blade Position from WMI, requires HP providers installed. | |
| For /F "delims== tokens=1-2" %%c in ('wmic /namespace:\\root\HPQ Path HP_BladeCSLocation Get PhysicalPosition /format:value^|find "PhysicalPosition=" ') do set PhysicalPosition=%%d | |
| :: C7000 chassis has 16 slots, make sure it is not out of range. | |
| if NOT %PhysicalPosition% gtr 0 IF NOT %PhysicalPosition% lss 17 GOTO Invalid_Bay_Number | |
| :: Pad to 2 digits. | |
| if %PhysicalPosition% lss 10 set PhysicalPosition=0%PhysicalPosition% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment