Update-WASJob

Update-WASJob

Adds assets and assessments to a specified job.

Sintaxis

Parameter Set: AddAssessment
Update-WASJob [-Job] <WASJob[]> -Assessment <WASAssessment[]> [ <CommonParameters>]

Parameter Set: AddAsset
Update-WASJob [-Job] <WASJob[]> [-Computer] <WASComputer[]> [[-Image] <WASImage> ] [[-UnattendFile] <String> ] [-CustomImage] [ <CommonParameters>]

Descripción detallada

The Update-WASJob cmdlet is used to add assessments, computers, and images to the job object in memory. After you add assets or assessments, you can invoke the job but you can't save it back to the server.

The AddAssessment parameter set adds assessments. The AddAsset parameter set adds computers, images, and unattended answer files. However, you can’t combine these two parameter sets on the same command line.

The Job parameter is required, and either the Assessment or the Computer parameter is also required.

Parámetros

-Assessment<WASAssessment[]>

Specifies a list of assessments to add the job. The assessments that are added use the recommended settings. If you create a custom assessment that does not include default assessment settings, the assessment could fail at run time.

To get a list of available assessments, use the Get-WASAssessment cmdlet.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Computer<WASComputer[]>

Specifies a list of computer objects to add to the job. To get the computer object, use the Get-WASComputer cmdlet.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CustomImage

Specifies that a predefined image is applied to the computers being added to the job. This means that you use a deployment method other than . The job holds the computer until the image is deployed to the computers.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Image<WASImage>

Specifies the image object to apply to the computers being added to the job. This means that you use for deployment. To get the image object, use the Get-WASImage cmdlet.

Alias

ninguno

¿Requerido?

false

¿Posición?

3

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Job<WASJob[]>

Specifies the job to update. This is a required parameter. To get the job object, use the Get-WASJob cmdlet. The job you update can't be saved to the server.

Alias

ninguno

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

true (ByValue)

¿Aceptar caracteres comodín?

false

-UnattendFile<String>

Specifies the unattended answer file to use when deploying the image to the computer. The string is the path to the unattend file stored in the /relax/unattendfiles share on the server.

Alias

ninguno

¿Requerido?

false

¿Posición?

4

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

Ejemplos

Example 1: Add assessments to a job and then run it

The first command gets the job and saves it as a variable.

PS C:\> $job = Get-WASJob -JobName "Automated Job"

The second command gets the assessments and saves it as a variable.

PS C:\> $assessments = Get-WASAssessment -AssessmentName minifilter*

The third command adds the assessments to the job.

PS C:\> Update-WASJob -Job $job -Assessment $assessments

This command runs the job.

PS C:\> Invoke-WASJob -Job $job

Example 2: Add computers to a job and then run it

The first command gets the job and saves it as a variable.

PS C:\> $job = Get-WASJob -JobName "Automated Job"

The second command gets the computers and saves the objects as a variable.

PS C:\> $computers = Get-WASComputer -ComputerName *toast

The third command tells that no image deployment is necessary.

PS C:\> $job.ApplyImage = $false

The fourth command adds the computers to the job.

PS C:\> Update-WASJob -Job $job -Computer $computers

This command runs the job.

PS C:\> Invoke-WASJob -Job $job

Example 3: Add computers and images to a job and then run it

The first command gets the job and saves it as a variable.

PS C:\> $job = Get-WASJob -JobName "Automated Job"

The second command gets the computers and saves the objects as a variable.

PS C:\> $computers = Get-WASComputer -ComputerName *toast

The third command gets the image and saves it as a variable.

PS C:\> $image = Get-WASImage -ImageName *Consumer*

The fourth command tells to deploy the image to the computers.

PS C:\> $job.ApplyImage = $true

The fifth command adds the computers, and the image to the job.

PS C:\> Update-WASJob -Job $job -Computer $computers -Image $image

This command runs the job.

PS C:\> Invoke-WASJob -Job $job

Temas relacionados

Get-WASAssessment

Get-WASComputer

Get-WASImage

Get-WASJob

Windows Assessment Services Technical Reference