LogoLogo
OSDeploy.comTwitterGitHubPowerShell Gallery
  • OSD PowerShell Module
  • Functions
  • Docs
    • OSDCloud
    • OSDPad
    • OSDHelp
      • Autopilot
    • Guides
      • UEFI System Firmware Update
      • In Your Code
      • New-OSDBoot.usb
      • Partitions
        • New-OSDDisk (Information)
        • New-OSDDiskWinPE (GPT)
        • New-OSDDiskWinPE (2 Disks)
        • AutoUnattend.xml
    • OSDWindowsImage
    • Windows Setup Environment
      • Execution Policy
      • WinSE Settings
      • Import Modules
      • Automation
    • Release Notes
    • Trash
      • Adk
        • Edit-ADKwinpe.wim
        • Get-ADKpaths
        • New-ADK.iso
        • New-ADKcopype
      • Appx
      • Block
      • CloudDriver
      • Dell
        • Get-DellCatalogPC
        • Get-MyDellBIOS
        • Update-MyDellBios
      • Disk
        • Backup-Disk.ffu
        • Clear-LocalDisk
        • Clear-USBDisk
        • Get-LocalDisk
        • Get-OSDDisk
        • Get-USBDisk
        • New-OSDisk
          • Old Version
            • Sandbox
            • Partition Layout
            • Partition Sizes
            • Volume Labels
            • AutoUnattend.xml
        • Get-USBVolume
      • Dism
        • Get-MyWindowsCapability
        • Get-MyWindowsPackage
        • Set-WimExecutionPolicy
        • Set-WindowsImageExecutionPolicy
      • Display
        • Get-VidConRes
      • Driver
        • Get-OSDDriverWmiQ
        • Get-OSDDriver
      • General
        • Get-OSD
        • Get-OSDClass
        • Get-OSDGather
        • Get-OSDPower
        • Get-RegCurrentVersion
        • Get-SessionsXml
        • Save-OSDDownload
      • MyBitLocker
        • Get-MyBitLockerKeyProtectors
        • Backup-MyBitLocker
        • Save-MyBitLockerExternalKey
        • Save-MyBitLockerKeyPackage
        • Save-MyBitLockerRecoveryPassword
        • Unlock-MyBitLockerExternalKey
      • OOBE
      • PSModule
        • Copy-PSModuleToFolder
        • Copy-PSModuleToWim
        • Copy-PSModuleToWindowsImage
      • WebConnection
      • WebPSScript
      • WinPEWim
      • WinPE
        • Enable-PEWimPSGallery
        • Get-OSDWinPE
Powered by GitBook
On this page
  • DiskNumber
  • ClearDisk = All
  • SelectDisk

Was this helpful?

  1. Docs
  2. Trash
  3. Disk
  4. New-OSDisk
  5. Old Version

Sandbox

19.10.11 David Segura

PreviousOld VersionNextPartition Layout

Last updated 5 years ago

Was this helpful?

New-OSDDisk contains alot of parameters that you need to learn. Keep in mind this function was designed to run in WinPE | WinRE | WinSE and it will not execute in Windows OS. Rather than just throw an error and quit in full Windows Client, an Information Mode was designed. Use Sandbox to test your parameters

Run New-OSDDisk without any parameters as a quick test, don't worry, it will not perform anything destructive in Windows OS, even when adding the Force parameter

New-OSDDisk

DiskNumber

#Fixed Disk Number
#Alias = Disk, Number
[Alias('Disk','Number')]
[int]$DiskNumber

The DiskNumber is automatically selected for you if you only have one Fixed Disk. You will receive a prompt to select the disk if you have multiple Fixed Disks unless you set this parameter. You can easily change this to whatever Disk you want as your OSDDisk

ClearDisk = All

#Clear-Disk Scope
#All will Clear all non-RAW Fixed Disks
#OSDDisk will Clear only the DiskNumber or SelectDisk
#Default = All
#Alias = Clear
[Alias('Clear')]
[ValidateSet('All','OSDDisk')]
[string]$ClearDisk = 'All'

New-OSDDisk will Clear-Disk every Fixed Disk by default to ensure that all the drives are clean. You can change this to OSDDisk and it will only clear the Disk that will be the OSDDisk

New-OSDDisk -ClearDisk OSDDisk

SelectDisk

#Select OSDDisk if multiple Fixed Disks are present
#Supersedes the DiskNumber parameter
#Ignored if only one Fixed Disk is present
[switch]$SelectDisk

This is a good parameter to use if you have systems with multiple drives. This will prompt you to select a Fixed Disk to use before continuing. On systems with a single Fixed Disk, there will not be any prompts

I recommend using this parameter by default for Interactive installations

New-OSDDisk -SelectDisk