Muistiinpano
Tämän sivun käyttö edellyttää valtuutusta. Voit yrittää kirjautua sisään tai vaihtaa hakemistoa.
Tämän sivun käyttö edellyttää valtuutusta. Voit yrittää vaihtaa hakemistoa.
This topic describes how to create a formatting file (Format.ps1xml).
Note
You can also create a formatting file by making a copy of one of the files provided by Windows
PowerShell. To protect the users of your Format.ps1xml file, sign the file using a digital
signature. For more information, see about_Signing.
Create a Format.ps1xml file
Open a new text file using a text editor such as Visual Studio Code.
Copy the following lines into the formatting file.
<?xml version="1.0" encoding="utf-8"?> <Configuration> <ViewDefinitions> </ViewDefinitions> </Configuration>The
<Configuration></Configuration>tags define the rootConfigurationnode. All additional XML tags will be enclosed within this node.The
<ViewDefinitions></ViewDefinitions>tags define theViewDefinitionsnode. All views are defined within this node.
Save the file to a folder of your choice. If you are writing a module, save the file to a subfolder of the module folder. Use the following name format when you save the file:
MyFile.Format.ps1xml. Formatting files must use the.ps1xmlextension.You are now ready to add views to the formatting file. There is no limit to the number of views that can be defined in a formatting file. You can add a single view for each object, multiple views for the same object, or a single view that is used by multiple objects.
See also
PowerShell