Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Modify alias output to remove part of name

$
0
0

I'd like to have assistance with removing characters from an alias when calling the alias to create a file.

Alias: $URL_FILE = C:\Directory\Output

Alias: $URL = http://sitename.com

Script collects some data that is being piped into a file;
previous collection | Add-Content $URL_FILE-$URL

The script  errors when attempting to create the file since the name would contain "http://". I would like to know how I can create the file, while calling $URL, but with removing the "http://" portion of the $URL alias.

Thank you in advance.





Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>