PowerShell File
- 14 April
PowerShell Convert Word to PDF
Using Microsoft Word COM Object To convert the given Microsoft Word document to PDF: Create a COM object using the New-Object cmdlet. Use the Open() method to open the MS Word file. Use the SaveAs() method to save the PDF file. Use the Close() method to close the Word document. Use the Quit() method to […]
- 14 April
PowerShell Check If File Contains String
Using Select-String Cmdlet Use the Select-String cmdlet to check if the specified file contains the given string in PowerShell. [crayon-673ef43aed028824744249/] [crayon-673ef43aed033832186400/] First, we declared and initialized a variable named $path containing the location of the file1.txt file. Then, we created another variable called $string and set its value with "customers"; this is the value we […]