New-​CM​Prestage​Media

Creates a prestage media

Syntax

New-CMPrestageMedia
   [-AllowUacPrompt]
   [-AllowUnattended]
   [-AllowUnknownMachine]
   [-Application <IResultObject[]>]
   -BootImage <IResultObject>
   [-CertificateExpireTime <DateTime>]
   [-CertificatePassword <SecureString>]
   [-CertificatePath <String>]
   [-CertificateStartTime <DateTime>]
   [-Comment <String>]
   [-Confirm]
   [-CreatedBy <String>]
   [-DisableWildcardHandling]
   -DistributionPoint <IResultObject[]>
   [-DriverPackage <IResultObject[]>]
   [-Force]
   [-ForceWildcardHandling]
   [-IncludeApplicationDependency]
   -ManagementPoint <IResultObject[]>
   -MediaMode <MediaMode>
   [-MediaPassword <SecureString>]
   -OperatingSystemImage <IResultObject>
   [-OperatingSystemImageIndex <Int32>]
   [-Package <IResultObject[]>]
   -Path <String>
   [-PrestartCommand <String>]
   [-PrestartPackage <IResultObject>]
   [-ProviderCredential <PSCredential>]
   -TaskSequence <IResultObject>
   [-UserDeviceAffinity <UserDeviceAffinityType>]
   [-Variable <Hashtable>]
   [-Version <String>]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-CMPrestagedMedia cmdlet creates a file to prestage on a new hard drive that includes an operating system image.

Examples

Example 1

PS C:\> $ManagementPoint = Get-CMManagementPoint -SiteSystemServerName "dist01.contoso.com" -SiteCode "CM1"
PS C:\> $BootImage = Get-CMBootImage -Name "BootImage01"
PS C:\> $DistributionPoint = Get-CMDistributionPoint -SiteSystemServerName "dist01.contoso.com" -SiteCode "CM1"
PS C:\> $OSImage = Get-CMOperatingSystemImage -Name "OSImagePkg01"
PS C:\> New-CMPrestagedMedia -MediaMode Dynamic -Path "\\server\share\PrestargedMedia.wim" -BootImage $BootImage -DistributionPoint $DistributionPoint -ManagementPoint $ManagementPoint -OperatingSystemImage $OSImage

The first command gets the management point object for the site system server named dist01.contoso.com with the site code CM1 and stores the object in the $ManagementPoint variable.

The second command gets the boot image object named BootImage01 and stores the object in the $BootImage variable.

The third command gets the Distribution point object for the site system server named dist01.contoso.com with the site code CM1 and stores the object in the $DistributionPoint variable.

The fourth command gets the operating system image object named OSImagePkg01 and stores the object inthe $OSImage variable.

The last command creates a dynamic prestaged media file named PrestargedMedia.wim with the boot image stored in $BootImage, the distribution point stored in $DistributionPoint, the management point stored in $ManagementPoint, and the operating system image stored in $OSImage.

Required Parameters

-BootImage

{{Fill BootImage Description}}

Type:IResultObject
Aliases:BootImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DistributionPoint

{{Fill DistributionPoint Description}}

Type:IResultObject[]
Aliases:DistributionPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ManagementPoint

{{Fill ManagementPoint Description}}

Type:IResultObject[]
Aliases:ManagementPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaMode

{{Fill MediaMode Description}}

Type:MediaMode
Parameter Sets:Dynamic, SiteBased
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImage

{{Fill OperatingSystemImage Description}}

Type:IResultObject
Aliases:OperatingSystemImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Path

{{Fill Path Description}}

Type:String
Aliases:MediaPath, OutputPath, DriveName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TaskSequence

{{Fill TaskSequence Description}}

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AllowUacPrompt

{{Fill AllowUacPrompt Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnattended

{{Fill AllowUnattended Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnknownMachine

{{Fill AllowUnknownMachine Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Application

{{Fill Application Description}}

Type:IResultObject[]
Aliases:Applications
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateExpireTime

{{Fill CertificateExpireTime Description}}

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePassword

{{Fill CertificatePassword Description}}

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePath

{{Fill CertificatePath Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateStartTime

{{Fill CertificateStartTime Description}}

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Comment

{{Fill Comment Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CreatedBy

{{Fill CreatedBy Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DriverPackage

{{Fill DriverPackage Description}}

Type:IResultObject[]
Aliases:DriverPackages, PackageDriver, PackageDrivers
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

{{Fill Force Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeApplicationDependency

{{Fill IncludeApplicationDependency Description}}

Type:SwitchParameter
Aliases:IncludeApplicationDependencies
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaPassword

{{Fill MediaPassword Description}}

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImageIndex

{{Fill OperatingSystemImageIndex Description}}

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Package

{{Fill Package Description}}

Type:IResultObject[]
Aliases:Packages
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartCommand

{{Fill PrestartCommand Description}}

Type:String
Aliases:PreExecCommandLine
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartPackage

{{Fill PrestartPackage Description}}

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProviderCredential

{{Fill ProviderCredential Description}}

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserDeviceAffinity

{{Fill UserDeviceAffinity Description}}

Type:UserDeviceAffinityType
Parameter Sets:DoNotAllow, AdministratorApproval, AutoApproval
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Variable

{{Fill Variable Description}}

Type:Hashtable
Aliases:TaskSequenceVariables, Variables
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Version

{{Fill Version Description}}

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object