mirror of
https://github.com/paradizelost/Powershell-Public.git
synced 2024-11-28 19:34:03 -06:00
Update teedy.ps1
This commit is contained in:
parent
00547f0d6d
commit
5f0ebc959b
17
teedy.ps1
17
teedy.ps1
@ -40,25 +40,12 @@ $tagtocreate = @{
|
|||||||
parent="";
|
parent="";
|
||||||
color='#3a87ad'
|
color='#3a87ad'
|
||||||
}
|
}
|
||||||
$tagjson = $tagtocreate|ConvertTo-Json
|
$newtagid = Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagtocreate -ContentType 'application/x-www-form-urlencoded'
|
||||||
$tagurlencode = [System.Web.HttpUtility]::UrlEncode($tagtocreate)
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagjson -ContentType "application/json"
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -form $tagtocreate
|
|
||||||
Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagtocreate -ContentType 'application/x-www-form-urlencoded'
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagurlencode -ContentType 'application/x-www-form-urlencoded'
|
|
||||||
$doctocreate=@{
|
$doctocreate=@{
|
||||||
title="testDoc";
|
title="testDoc";
|
||||||
language="eng";
|
language="eng";
|
||||||
}
|
}
|
||||||
$docjson = $doctocreate|ConvertTo-Json
|
$newdocid = Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $doctocreate -ContentType 'application/x-www-form-urlencoded'
|
||||||
$docurlencode = [System.Web.HttpUtility]::UrlEncode($doctocreate)
|
|
||||||
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $docjson -ContentType 'application/json'
|
|
||||||
Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $doctocreate -ContentType 'application/x-www-form-urlencoded'
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -form $doctocreate
|
|
||||||
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $docurlencode -ContentType 'application/x-www-form-urlencoded'
|
|
||||||
|
|
||||||
|
|
||||||
$logoutresponse = Invoke-webrequest -Uri "$siteurl/api/user/logout" -Headers $headers -Method POST
|
$logoutresponse = Invoke-webrequest -Uri "$siteurl/api/user/logout" -Headers $headers -Method POST
|
||||||
if($logoutresponse.BaseResponse.StatusCode -eq 200){
|
if($logoutresponse.BaseResponse.StatusCode -eq 200){
|
||||||
write-host "logged out successfully"
|
write-host "logged out successfully"
|
||||||
|
Loading…
Reference in New Issue
Block a user