Cmdlet
Get-OfficePrintJob
Reports the state of a print job submitted with Send-OfficePrinter, optionally waiting until it finishes. Requires PowerShell 7.4 or newer.
Syntax
Get-OfficePrintJob
[-JobId] <String>
[-PrinterName] <String>
[-TimeoutSeconds <Int32>]
[-Wait]
[<CommonParameters>]#Parameter set:
DefaultDescription
States are the same for every transport: Pending, Held, Processing, Stopped, Canceled, Aborted, Completed and Removed. Removed means the queue no longer reports the job: it finished and was purged, was deleted, or never existed.
Examples
Wait up to two minutes for a submitted job.
$receipt = Send-OfficePrinter -Path .\Report.pdf -PrinterName 'Office printer'
$receipt | Get-OfficePrintJob -Wait -TimeoutSeconds 120Check a job by printer and identifier.
Get-OfficePrintJob -PrinterName 'Office printer' -JobId 'Office_printer-42'Parameters
- -JobId String
- The job identifier from the receipt.
- -PrinterName String
- The printer queue name or IPP URI from the receipt.
- -TimeoutSeconds Int32
- Longest wait in seconds when Wait is set.
- -Wait SwitchParameter
- Wait until the job is canceled, aborted, completed or removed.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.