New-CMPrestageMedia

Creates a prestage media

Syntax

New-CMPrestageMedia
   [-Application <IResultObject[]>]
   [-Comment <String>]
   [-CreatedBy <String>]
   [-DriverPackage <IResultObject[]>]
   -OperatingSystemImage <IResultObject>
   [-OperatingSystemImageIndex <Int32>]
   [-Package <IResultObject[]>]
   [-Version <String>]
   [-IncludeApplicationDependency]
   -TaskSequence <IResultObject>
   [-AllowUacPrompt]
   [-AllowUnattended]
   [-AllowUnknownMachine]
   -BootImage <IResultObject>
   [-CertificateExpireTime <DateTime>]
   [-CertificatePassword <SecureString>]
   [-CertificatePath <String>]
   [-CertificateStartTime <DateTime>]
   -DistributionPoint <IResultObject[]>
   [-Force]
   -ManagementPoint <IResultObject[]>
   -MediaMode <MediaMode>
   [-MediaPassword <SecureString>]
   -Path <String>
   [-PrestartCommand <String>]
   [-PrestartPackage <IResultObject>]
   [-ProviderCredential <PSCredential>]
   [-UserDeviceAffinity <UserDeviceAffinityType>]
   [-Variable <Hashtable>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<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
Type:IResultObject
Aliases:BootImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DistributionPoint
Type:IResultObject[]
Aliases:DistributionPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ManagementPoint
Type:IResultObject[]
Aliases:ManagementPoints
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaMode
Type:MediaMode
Parameter Sets:Dynamic, SiteBased
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImage
Type:IResultObject
Aliases:OperatingSystemImagePackage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Path
Type:String
Aliases:MediaPath, OutputPath, DriveName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TaskSequence
Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AllowUacPrompt
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnattended
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllowUnknownMachine
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Application
Type:IResultObject[]
Aliases:Applications
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateExpireTime
Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePassword
Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificatePath
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CertificateStartTime
Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Comment
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
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
Type:IResultObject[]
Aliases:DriverPackages, PackageDriver, PackageDrivers
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force
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
Type:SwitchParameter
Aliases:IncludeApplicationDependencies
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaPassword
Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImageIndex
Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Package
Type:IResultObject[]
Aliases:Packages
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartCommand
Type:String
Aliases:PreExecCommandLine
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrestartPackage
Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProviderCredential
Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserDeviceAffinity
Type:UserDeviceAffinityType
Parameter Sets:DoNotAllow, AdministratorApproval, AutoApproval
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Variable
Type:Hashtable
Aliases:TaskSequenceVariables, Variables
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Version
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