Cmdlet
Set-OfficePdfAnnotation
Updates native annotation contents, styling and actions by identity or target URI.
Syntax
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Document <PdfDocument>]
[-Flags <Int32>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
[-PassThru]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
DocumentSet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathSet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathDirectorySet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathUriSet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathUriDirectorySet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathSet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathUriSet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathDirectorySet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathUriDirectorySet-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Document <PdfDocument>]
[-Flags <Int32>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
[-PassThru]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
DocumentUriDescription
Native confirmation runs before loading or editing a file. Live inputs stay caller-owned; a replacement document is adopted by the enclosing content block or returned for explicit assignment. PassThru returns native edit reports.
Examples
Example 1
Set-OfficePdfAnnotation -ObjectNumber 1Example 2
Set-OfficePdfAnnotation -Uri 'https://example.com'Example 3
Set-OfficePdfAnnotation -OutputPath 'C:\Path' -ObjectNumber 1 -LiteralPath @('C:\Path')Parameters
- -Color OfficeColor
- Replacement annotation RGB color.
- -Contents String
- Contents setting.
- -Document PdfDocument
- Native caller-owned PDF; omission uses the enclosing content block.
- -Flags Int32
- Raw PDF annotation flags.
- -Name String
- Name setting.
- -ObjectNumber Int32
- ObjectNumber setting.
- -Options PdfAnnotationUpdateOptions
- Native annotation edit policy and fields. Explicit parameters override this captured policy; append-only residual data remains opt-in.
- -PassThru SwitchParameter
- Return native annotation edit reports.
- -RemoveAction SwitchParameter
- RemoveAction setting.
- -Title String
- Title setting.
- -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- Prompts for confirmation before running the command.
- -IgnorePermissionRestrictions SwitchParameter
- IgnorePermissionRestrictions setting.
- -LoadOptions PdfLoadOptions
- Native parsing, authentication and resource policy.
- -OutputPath String
- Single-file destination.
- -Password SecureString
- Password setting.
- -Path String[]
- Input PDF paths with wildcard expansion.
- -OutputDirectory String
- Batch destination retaining source names.
- -Uri String
- Exact or wildcard target URI used to select link annotations.
- -LiteralPath String[]
- Literal input PDF paths; accepts FileInfo.FullName.
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.