Avatar of Aaron Greene
Aaron GreeneFlag for United States of America

asked on 

Write a text file with powershell

I am looking for a way to write/overwrite a text file using powershell.  I have been using a .bat file to do this, but am wanting to get a quick intro to powershell.  I have no experience with powershell.  I have a text file at the following location: C:\REP_Reports\InTouch\Mode\Mode.txt

This text file sets the operating mode for a macro-enabled excel workbook.  The value in the text file will be a 1,2 or 9.

When the script executes, I want it to overwrite the existing file with the value 1.
Powershell

Avatar of undefined
Last Comment
oBdA
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Powershell
Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

27K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo