What am I doing wrong with Out-File? [duplicate]
I cannot get this command to output to text file. I am trying to use the out-file command.
#Trim up the URL
$data = get-content C:\Dell\Temp\urlhausCopyDL.txt
$data | ForEach-Object {
$items = $_.split(":")
write-host (-join('http:',$items[1])) | Out-File "C:\Dell\Temp\Formulated.txt" -Append
}
It creates the file but it is blank.
It splits the URL and removes whatever is after the second : as we don't need it.
It outputs to Console great, but I just cant get it to write to a file!! :(
A snippet of urlhauscopyDL is here for you:
http://115.55.196.162:57955/bin.sh
http://182.240.54.209:60488/bin.sh
http://176.231.66.63:49310/.i
Thankyou For your help team :)
精彩评论