Cmdlet
New-OfficeVisio
Creates a Visio document with an initial page, returning it live or saving a completed content block.
Syntax
New-OfficeVisio
[-Author <String>]
[-DisplayUnit <Inches| Centimeters| Millimeters>]
[-Force]
[-Height <OfficeLength>]
[-PageName <String>]
[[-Path] <String>]
[-RequestRecalcOnOpen]
[-Title <String>]
[-UseMastersByDefault]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiveNew-OfficeVisio
[-AllowLoss]
[-Author <String>]
[-Content] <ScriptBlock>
[-DisplayUnit <Inches| Centimeters| Millimeters>]
[-Force]
[-Height <OfficeLength>]
[-PageName <String>]
[-PassThru]
[-Path] <String>
[-RequestRecalcOnOpen]
[-Show]
[-Title <String>]
[-UseMastersByDefault]
[-Width <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
ContentDescription
Without a block no file is written. A block publishes only after success; an existing destination requires Force. Geometry carries its own unit; DisplayUnit controls the page rulers.
Examples
Create and save a service map.
New-OfficeVisio -Path ./ServiceMap.vsdx -Title 'Service map' {
VisioRectangle -Key web -Text 'Web' -X 1in -Y 4in
VisioRectangle -Key api -Text 'API' -X 4in -Y 4in
VisioConnector -From web -To api -Label 'calls'
}Create a live landscape diagram and save it explicitly.
$diagram = New-OfficeVisio -Width 11in -Height 8.5in
Save-OfficeVisio -Document $diagram -Path ./Landscape.vsdxParameters
- Optional document author.
- -DisplayUnit VisioMeasurementUnit
- Measurement unit displayed by Visio, independent of geometry input units.
- Possible values:
Inches,Centimeters,Millimeters - -Force SwitchParameter
- Allow a completed content block to replace an existing destination.
- -Height OfficeLength
- Initial page height; defaults to A4 portrait.
- -PageName String
- Initial page name.
- -Path String
- Optional associated destination for a live document; required when a content block saves a file.
- -RequestRecalcOnOpen SwitchParameter
- Ask Visio to recalculate layout and connector routing on opening.
- -Title String
- Optional document title.
- -UseMastersByDefault SwitchParameter
- Use Visio masters for supported built-in stencil shapes when saving.
- -Width OfficeLength
- Initial page width; defaults to A4 portrait.
- -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- Prompts for confirmation before running the command.
- -AllowLoss SwitchParameter
- Explicitly accept reductions reported by the content block's native save.
- -Content ScriptBlock
- Authoring block to complete before the document is atomically saved and closed.
- -PassThru SwitchParameter
- Return the saved FileInfo after a completed content block.
- -Show SwitchParameter
- Open the saved result in its registered application after the content block succeeds.
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.