enthuguy
asked on
Powershell single line file exists check
Hi Powershell experts,
please help me in the logic. Below is the current single line script.
Would like extend a bit by
please help me in the logic. Below is the current single line script.
foreach($line in Get-Content C:\filepath.txt){(Get-Content $line).replace('DB_URL', ${RDSInstance.Endpoint.Address}) ^| Set-Content $line}
Would like extend a bit by
- check if file exists, then apply replace logic,
- else get next line
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oBdA has the better solution..
ASKER
Thanks a lot oBdA, ITguy,
will test these :)
will test these :)
Open in new window