PoshCode Archive  Artifact [0558a0c2d6]

Artifact 0558a0c2d6ab78995e631f6e3ddfb5540210fe330bbc850e5099dcb1be5ddb6a:

  • File Find-and-Replace-Data.ps1 — part of check-in [a693089183] at 2018-06-10 14:20:21 on branch trunk — You know unwanted data is in a string within a file, but you don’t know what it is. You need to have it replaced with a scheduled ps1 script. (user: Danielle size: 688)

# encoding: ascii
# api: powershell
# title: Find and Replace Data
# description: You know unwanted data is in a string within a file, but you don’t know what it is.  You need to have it replaced with a scheduled ps1 script.
# version: 0.1
# author: Danielle
# license: CC0
# x-poshcode-id: 6747
# x-archived: 2017-05-22T05:27:04
# x-published: 2017-02-22T18:10:00
#
#

	##### Get current Content-ID in Preamble.xml
	cat ./Preamble.xml | findstr Content-ID: > ./Content-ID
	$ID = Get-Content ./Content-ID
	$ID = $ID.substring(13,15)

	##### Replace Content-ID in Preamble.xml
	( Get-Content ./Preamble.xml ) -replace "$ID" , "$STAMP" | 
	Set-Content ./Preamble.xml