@@ -6,7 +6,7 @@ function Await-Task {
66
77 process {
88 while (-not $task.AsyncWaitHandle.WaitOne (200 )) { }
9- $task.GetAwaiter ().GetResult()
9+ $task.GetAwaiter ()
1010 }
1111}
1212
@@ -25,38 +25,52 @@ $bar = New-Object Appwrite.Bar -ArgumentList $client
2525$general = New-Object Appwrite.General - ArgumentList $client
2626
2727$list = $ (" string in array" )
28- $response = $foo.get (" string" , 123 , $list ) | Await- Task
29- Print- Response $response
28+ $response = $foo.Get (" string" , 123 , $list ) | Await- Task
29+ Print- Response $response.GetResult ()
3030
31- $response = $foo.post (" string" , 123 , $list ) | Await- Task
32- Print- Response $response
31+ $response = $foo.Post (" string" , 123 , $list ) | Await- Task
32+ Print- Response $response.GetResult ()
3333
34- $response = $foo.put (" string" , 123 , $list ) | Await- Task
35- Print- Response $response
34+ $response = $foo.Put (" string" , 123 , $list ) | Await- Task
35+ Print- Response $response.GetResult ()
3636
37- $response = $foo.patch (" string" , 123 , $list ) | Await- Task
38- Print- Response $response
37+ $response = $foo.Patch (" string" , 123 , $list ) | Await- Task
38+ Print- Response $response.GetResult ()
3939
40- $response = $foo.delete (" string" , 123 , $list ) | Await- Task
41- Print- Response $response
40+ $response = $foo.Delete (" string" , 123 , $list ) | Await- Task
41+ Print- Response $response.GetResult ()
4242
43- $response = $bar.get (" string" , 123 , $list ) | Await- Task
44- Print- Response $response
43+ $response = $bar.Get (" string" , 123 , $list ) | Await- Task
44+ Print- Response $response.GetResult ()
4545
46- $response = $bar.post (" string" , 123 , $list ) | Await- Task
47- Print- Response $response
46+ $response = $bar.Post (" string" , 123 , $list ) | Await- Task
47+ Print- Response $response.GetResult ()
4848
49- $response = $bar.put (" string" , 123 , $list ) | Await- Task
50- Print- Response $response
49+ $response = $bar.Put (" string" , 123 , $list ) | Await- Task
50+ Print- Response $response.GetResult ()
5151
52- $response = $bar.patch (" string" , 123 , $list ) | Await- Task
53- Print- Response $response
52+ $response = $bar.Patch (" string" , 123 , $list ) | Await- Task
53+ Print- Response $response.GetResult ()
5454
55- $response = $bar.delete (" string" , 123 , $list ) | Await- Task
56- Print- Response $response
55+ $response = $bar.Delete (" string" , 123 , $list ) | Await- Task
56+ Print- Response $response.GetResult ()
5757
5858$response = $general.Redirect () | Await- Task
59- Print- Response $response
59+ Print- Response $response.GetResult ()
6060
6161$response = $general.Upload (" string" , 123 , $list , (Get-Item " ../../../../resources/file.png" )) | Await- Task
62- Print- Response $response
62+ Print- Response $response.GetResult ()
63+
64+ try {
65+ $response = $general.Error400 () | Await- Task
66+ $response.GetResult ()
67+ } catch [Appwrite.AppwriteException ] {
68+ Write-Host $_.Exception.Message
69+ }
70+
71+ try {
72+ $response = $general.Error500 () | Await- Task
73+ $response.GetResult ()
74+ } catch [Appwrite.AppwriteException ] {
75+ Write-Host $_.Exception.Message
76+ }
0 commit comments