Perform the following steps to configure the registry to implement these changes. Enable the auto-save feature so that there will be no dialog prompts to ask for which file name to save.Change the auto-save file name to ZonesReport.Change the auto-save directory to C:\Reports.If PDFCreator is not the default printer, you can make it the default printer here.Ĭonfigure auto-save printer settings as follows: Verify that PDFCreator is the default printer by opening the Devices and Printers control panel. In this example, because PDFCreator is the sixth printer on the list, you would execute the following command: $printers.SetDefaultPrinter() For example, in the following list of printers, PDFCreator is the sixth printer listed: In the list of printers, note the position of the PDFCreator printer in the list. Run the following variable to list the printers: $printers Specify PDFCreator as the default printer:Įxecute the following command to get all installed printers: $printers = gwmi win32_printer When you execute this command, the file c:\Reports\ZonesReport.html is created using the styles in Report.css. \Report.css)" | Out-File c:\Reports\ZonesReport.html \ZonesReport.ps1 | ConvertTo-Html -Head "$(Get-Content. Generate HTML output from the ZonesReport.ps1 script by executing the following command in the PowerShell console. If the printer has a different name in your environment, use your printer’s name. In this example, the PDF printer that converts HTML to PDF is named “PDFCreator”.Unless otherwise noted, you perform the steps described here in the PowerShell console window.You must have administrator privileges to perform these steps.The following steps describe how to generate PDF output from the ZonesReport.ps1 script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |