Covert shell to powershell script
i new powershell , trying covert shell script powershell. can conversion?
`#! /bin/bash
repos=("repo-0" "repo-1" "repo-2" )
userpw="$1"
milestonetitle=$2
milestoneduedate=$3
echo $milestonetitle
echo $milestoneduedate
for in "${repos[@]}"
do
echo "adding milestone $milestonetitle git repo $i"
echo '{ "title" : "'"$milestonetitle"'", "state": "open", "due_on": "'"$milestoneduedate"'t00:00:00z" }'
curl --user $userpw --request post --data '{ "title" : "'"$milestonetitle"'", "state": "open", "due_on": "'"$milestoneduedate"'t00:00:00z" }' followed https request can not include in body of text
echo $i
done
'
thank you, walters
hi walters,
agree jrv, besides, script itself, suppose begin following sample:
$repos=@("repo-0", "repo-1", "repo-2" ) $userpw="$1" $milestonetitle='$2' $milestoneduedate='$3' write-host $milestonetitle write-host $milestoneduedate foreach($i in $repos) { write-host "adding milestone $milestonetitle git repo $i" write-host '{ "title" : "'"$milestonetitle"'", "state": "open", "due_on": "'"$milestoneduedate"'t00:00:00z" }' write-host $i }
in addition, i'll show tutorial of powershell refer:
hope these provides helps you.
best regards,
andy_pan
please remember mark replies answers if , unmark them if provide no help.
if have feedback technet subscriber support, contact tnmff@microsoft.com.
Windows Server > Windows PowerShell
Comments
Post a Comment