Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:58:47+00:00 2026-06-16T02:58:47+00:00

Trying to update a line using the code below. $dburl = 70.186.192.52 $ptdb =

  • 0

Trying to update a line using the code below.

 $dburl = 70.186.192.52
 $ptdb  = 3388

 $Se = "C:\File\location\edit.me"
(Get-Content $Se) |
   ForEach-Object { $_ -replace ("http://127.0.0.1:8190/storage/server"), 'http://$dburl:$ptdb/storage/server'  } | Set-Content $Se

The output is:

http://$dburl:$ptdb/storage/server or http://\70.186.192.52\:3388/storage/server

I have tried escaping the // and : but no luck in figuring this one out. Anyone have a better way to do this. I have looked through the site and none of the things that I have found address this direct situation. I say this so I don’t get any negitive marks for not researching the code.

powershell replace special characters

This one gives me what I am getting. Instead of the variable being substituted they are just printed out exactly as they are typed in. I have tried double quotes and it prints the port but not the address. if I put any escape / or \ it just prints it out in front.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:58:49+00:00Added an answer on June 16, 2026 at 2:58 am

    I’m surprised that worked at all. Try using double quotes around the replacement string e.g.:

    $dburl = '70.186.192.52'
    $ptdb  = '3388'
    ... -replace ("http://127.0.0.1:8190/storage/server"), "http://${dburl}:$ptdb/storage/server"
    

    Also, quote your two variable values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to update a file using Java with new data. Let 's
I'm trying to update the database using the ajax, but getting some error below
Im trying to update a table with the following code. If I change WHERE
When trying to update a subversion working copy from Netbeans, I get the following
Im trying to update the contents of an element after running some php code.
I'm trying to update my code to use cv2.SURF() as opposed to cv2.FeatureDetector_create(SURF) and
I am trying to update a database with values from a csv file, the
I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes .
I'm using the PHP code below to display CSS classes based on the custom
I am trying to seed users and roles into my database. Currently using Code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.