About 53 results
Open links in new tab
  1. powershell - Remove lines from a text file if it contains a string ...

    I am trying to remove all the lines from a text file that contains a partial string using the below PowerShell code: Get-Content C:\new\temp_*.txt | Select-String -pattern "H|159" -notma...

  2. PowerShell Delete File If Exists - Stack Overflow

    Feb 17, 2022 · Could you help me with a powershell script? I want to check if multiple files exist, if they exist then delete the files. Than provide information if the file has been deleted or information if the...

  3. How to remove all quotations mark in the csv file using powershell ...

    Mar 14, 2020 · 2 I would like remove all quotations character in my exported csv file, it's very annoying when i generated a new csv file and i need to manually to remove all the quotations that include in …

  4. Unblock a file with PowerShell? - Stack Overflow

    Oct 24, 2009 · If you are using PowerShell 3.0 or above vesion, Unblock-file PowerShell cmdlet should solve this problem with unblocking the file, even though if you don't have unblock button on the file …

  5. Remove alternative data stream using powershell

    Feb 14, 2023 · By default, these files are blocked to protect the computer from untrusted files. Before using the Unblock-File cmdlet, review the file and its source and verify that it is safe to open. …

  6. remove empty lines from text file with PowerShell

    Feb 10, 2012 · Start by get the content from file and trim the white spaces if any found in each line of the text document. That becomes the object passed to the where-object to go through the array looking …

  7. Using PowerShell to write a file in UTF-8 without the BOM

    Note: This answer applies to Windows PowerShell (the legacy, ships-with-Windows, Windows-only edition of PowerShell whose latest and last version is 5.1); by contrast, in the cross-platform …

  8. How to Remove ReadOnly Attribute on File Using PowerShell?

    May 21, 2009 · How can I remove the ReadOnly attribute on a file, using a PowerShell (version 1.0) script?

  9. How to remove OneDrive folder using PowerShell - Stack Overflow

    Feb 11, 2022 · 2 I'm trying to remove a user OneDrive folder using PowerShell but I'm not seeing any sucess even though I've been searching around internet so I would be really appreciated if I can get …

  10. powershell - remove all leading and trailing and blank spaces - Stack ...

    Apr 26, 2020 · If you read a file as an array, you can filter out blank lines using comparison operator -ne. You can remove a line's leading and trailing white space with the Trim() method.