Top > Using import templates > PowerShell sample calls

PowerShell sample calls

 

      The following basic call to the cmdlet imports a single template definition file, explicitly specifying the optional parameters Name and OnErrorAction:

Import-ProvanceDMPTemplate -LiteralPath "c:\mypath\myfolder\MyTemplateDefini­tion.xml" -Name MyImportedTemplate -OnErrorAction skip

   An advanced command set that attempts to import all the xml files in a specified folder path:

Get-ChildItem -Path "C:\Users\myfolder\Documents\Exported Templates\*" -Include *.xml | Select-Object -ExpandProperty FullName | Import-ProvanceDMPTemplate -OnErrorAc­tion skip

•   An advanced command set that attempts to import all the xml files in a specified folder path and explicitly sets the optional Name parameter to the filename. Although the filename to name conversion is the default action of the cmdlet, it shows the possibility of setting explicit names:

Get-ChildItem -Path "C:\Users\myfolder\Documents\Exported Templates\*" -Include *.xml | % {Import-ProvanceDMPTemplate -LiteralPath $($_.FullName) -Name $($_.BaseName) -OnErrorAction skip}