I'm many years late, but this article just helped me and I thank you very much!
Thank you for creating the "Replace-FileString.ps1" PowerShell script. I believe that it will be a useful script for my purposes.
And so, I have downloaded your Replace-FileString.ps1 PowerShell script file. But, when I try to run the script from a Command Prompt, it does not run. Instead, a text file that looks like the Release Notes file for the script is opened.
The version of PowerShell that is installed on my computer is v3.0. Previously, v2.0 of PowerShell was installed on my computer.
Please let me know what I am doing wrong or might be wrong with the setup of my computer and causing the Replace-FileString.ps1 script not to run.
Please read the article "Running PowerShell Scripts Is as Easy as 1-2-3" (http://windowsitpro.com/powershell/running-powershell-scripts-easy-1-2-3).
Bill, this is a nice and useful script. Except when the original file has special characters from foreign languages. You even have check for encoding and utf8 is accepted. But all the characters with diacritics from French, German etc. are replaced with a ? when you overwrite the file. And encoding is exactly the reason I was using this script - I am replacing 'encoding="Windows-1252"' with ' encoding="utf-8"' in a bunch of xml files. Can you think of a script change to allow the foreign characters to copied as they are? Thank you
Join John Savill for the ALL NEW PowerShell Master Class!
In this master-level training course, you get 9 hours of technical training that will make you a PowerShell Master!
Thursdays, February 11th through 25th
By the end of the course, you will understanding how to create custom modules to achieve amazing results in your environment, in non-Microsoft environments and in Azure.
Topics covered will include:
* PowerShell Fundamentals
* Remote Management
* Connecting Commands and Mastering Objects
* Scripting and Custom Modules
* State Configuration
* PowerShell Workflows, Orchestrator SMA, and Azure Automation
* And much more!
Get answers to questions, share tips, and engage with the IT professional community at myITforum. Are you a data center professional? Join AFCOM for the best data center insights.
Presented by John Savill
Thursdays, February 11th, 18th, and 25th
Enroll Now and Save $130!...
Presented by Johan Arwidmark
Wednesdays, February 17th-March 9th
Presented by Jen Underwood
Thursday, February 18th
This course will introduce SQL...
View CatalogView Shopping Cart
Sponsored Introduction Continue on to (or wait seconds) ×