• Powershell convert word to PDF
    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 […]

  • PowerShell check if file contains string
    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-6767b4e17d1b8974046857/] [crayon-6767b4e17d1be469544978/] 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 […]