script to overwrite a file

Welcome Forums General PowerShell Q&A script to overwrite a file

  • This topic has 3 replies, 4 voices, and was last updated 1 year ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #163791
      Participant
      Topics: 4
      Replies: 6
      Points: 59
      Rank: Member

      Hi,

      We have a client which has this application. The vendor of the app advised us to change a particular xml file in all computers. I was thinking of using a software deployment to run a powershell script to overwrite the existing filename

      Thanks

      Jeff

    • #163827
      Participant
      Topics: 5
      Replies: 2373
      Points: 6,010
      Helping Hand
      Rank: Community MVP

      Jefferson,

      welcome to Powershell.org. This is a forum for Powershell enthusiasts helping other Powershell enthusiasts with there self written Powershell code. If you’re looking for prewritten scripts or modules you should search Microsoft Technet Script Gallery or the Powershell Gallery or one of the many other places where you can find ready to use code.

      If you already have some code you wrote and just got stuck with it you should post this code here – formatted as code please – and ask a specific question about this particular piece of code and we will try to help you solving your problem.

      If I got you right you wouldn’t even need a script to accomplish your task. Any software deployment solution should be able to deliver an XML file overwriting an existing one without the need for a script. 😉

      Good luck.

      Edit: script to overwrite a file

    • #164028
      Participant
      Topics: 2
      Replies: 1013
      Points: 2,093
      Helping Hand
      Rank: Community Hero

      Ditto to what Olaf said, but it’s a built-in thing for PowerShell for file and folder creation.

      New-Item -Path 'd:\temp' -Name 'somefilename' -ItemType File -Force

       

       

       

    • #164274
      Participant
      Topics: 4
      Replies: 8
      Points: 95
      Rank: Member

      Hi Jeff,

      This seems to be more of a statement than question…

      Are you needing assistance with this?

       

Viewing 3 reply threads
  • The topic ‘script to overwrite a file’ is closed to new replies.