On The Value Of Tactics With Powershell's Multiple Find And Replace Oneliner

1. multi-replacer

  • I have a URL and for a case, it arrives copied from a browser, I need to remove both parts of the beginning and end
  • I have two cases so I employ a ternary operator for the little case analysis
  • I also natural line continuators for better readability
  • use parenthesis to make multiple operations with -replace
  • it would work also without "" within the command, but I prefer Python's
Explicit is better than implicit

2. links

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Python isn’t bad. Programmers are.

3 brilliant tools that extract data from emails

Setting Up a Sample Environment in Azure Cloud Platform

Colly Vs. Proxies API

You NEED to see these GraphHack projects!!

Web scraping 101

How Mobile Solutions Are Transforming the Construction Industry?

Fragments:102 Communicate with other fragments

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

More from Medium

How To Accept Multiple Values From Pipeline Into A Powershell Function

Ingesting and processing multiple lines in Linux using an array and loops.

SSIS Killswitch

Summary Linux Disk Related Commands