Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # powershell.exe -ExecutionPolicy Bypass -File \\stcasia\root\Public\Lab\Image\partition.ps1
- # Resize System partition
- $SizeMax = ( Get-PartitionSupportedSize -DriveLetter C ).SizeMax
- if ( ( Get-Partition -DriveLetter C ).Size -ne $SizeMax )
- {
- Resize-Partition -DriveLetter C -Size $SizeMax
- }
- # Remove CD-ROM drive letter
- $Volume = Get-WmiObject -Class Win32_Volume | Where-Object {
- ( $_.DriveLetter -eq 'E:' ) -and ( $_.Drivetype -eq 5 )
- }
- if ( $Volume -ne $null )
- {
- $Volume.DriveLetter = $null
- $Volume.put()
- }
- # Initialize the RAW data disk and create new partition
- Get-Disk | Where-Object PartitionStyle -EQ RAW | Initialize-Disk -PartitionStyle MBR -PassThru | `
- New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -Confirm:$false
- # Allow ICMP Echo Request
- netsh.exe firewall set icmpsetting 8
- # Enable PSRemoting
- Enable-PSRemoting -Force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement