petaganayr
asked on
Need help with a powershell script
I need help with writing a powershell script line.
I do not know how to pass the value of $Person.userName so the $url would look like this:
$url="http://mywordpresssite.org/?users=userA&secret=123supersecretkey4 56"
I've tried a few things but none of them are working.
Thank you!
$Userlist = Import-Csv "C:\userimport.csv"
ForEach ($Person in $Userlist) {
$Person.userName
$url="http://mywordpresssite.org/?users=$Person.userName&secret=123supersecretkey456"
(New-Object System.Net.WebClient).DownloadString("$url");
}
I do not know how to pass the value of $Person.userName so the $url would look like this:
$url="http://mywordpresssite.org/?users=userA&secret=123supersecretkey4
I've tried a few things but none of them are working.
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. yes, I've tried both earlier. And, I found out why none of them work. Writer error, I will curl up under a rock now.
Thank you! :D