Last active
January 5, 2022 15:39
-
-
Save JohnL4/60a660cb04c9873c35968db68d8d7c18 to your computer and use it in GitHub Desktop.
Mount a bunch of machine drives on drive letters
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
| $machDrives = @( | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb02x\C$"; drive = "X:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb01d\C$"; drive = "E:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb01q\C$"; drive = "Q:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisMnBld01s\C$"; drive = "H:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisMnWeb01s\C$"; drive = "I:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisMnWeb02s\C$"; drive = "J:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisMnWeb03s\C$"; drive = "K:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisBld01t\C$"; drive = "L:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb01t\C$"; drive = "M:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb02t\C$"; drive = "N:" }, | |
| # [PSCustomObject] @{ mach = "\\P8SisWeb03t\C$"; drive = "O:" }, | |
| [PSCustomObject] @{ mach = "\\P8SisBld01t\D$"; drive = "P:" }, | |
| [PSCustomObject] @{ mach = "\\P8SisMnBld01s\D$"; drive = "R:" } | |
| ) | |
| foreach ($machDrive in $machDrives) { | |
| NET USE $machDrive.drive /DEL | |
| NET USE $machDrive.drive $machDrive.mach | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment