[powershell] Updated the Api doc with httpsiging script snippet. (#7499)

* Added the httpsigning code snippet for api doc

* Updated the sample

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Ghufran Zahidi 2020-09-25 14:24:14 +05:30 committed by GitHub
parent 9ba943318a
commit d6bfecf2ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 89 additions and 62 deletions

View File

@ -54,7 +54,7 @@ To install and run `Pester`, please execute the following commands in the termin
```powershell
Install-module -name Pester -force
Invoker-Pester
Invoke-Pester
```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.

View File

@ -43,6 +43,18 @@ $Configuration["ApiKey"]["{{{keyParamName}}}"] = "YOUR_API_KEY"
# Configure OAuth2 access token for authorization: {{{name}}}
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
{{/isOAuth}}
{{#isHttpSignature}}
# Configure HttpSignature for authorization :{{name}}
$httpSigningParams = @{
KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8"
KeyFilePath = "C:\SecretKey.txt"
HttpSigningHeader = @("(request-target)","Host","Date","Digest")
HashAlgorithm = "sha256"
}
Set-{{{packageName}}}ConfigurationHttpSigning @httpSigningParams
{{/isHttpSignature}}
{{/authMethods}}
{{/hasAuthMethods}}
@ -54,7 +66,7 @@ ${{paramName}} = {{{vendorExtensions.x-powershell-example}}} # {{{dataType}}} |
# {{{.}}}
{{/summary}}
try {
{{#returnType}}{{returnType}} $Result = {{/returnType}}{{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}}
$Result = {{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}}
} catch {
Write-Host ("Exception occured when calling {{{vendorExtensions.x-powershell-method-name}}}: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -69,7 +81,7 @@ Name | Type | Description | Notes
{{/allParams}}
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
### Authorization

View File

@ -12,7 +12,7 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} `
${{{classname}}} = Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} `
{{/hasMore}}
{{/vars}}
@ -20,7 +20,7 @@ Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#ha
- Convert the resource to JSON
```powershell
${{className}} | Convert-ToJSON
${{{classname}}} | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -44,7 +44,7 @@ To install and run `Pester`, please execute the following commands in the termin
```powershell
Install-module -name Pester -force
Invoker-Pester
Invoke-Pester
```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.

View File

@ -11,14 +11,14 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreApiResponse -Code null `
$ApiResponse = Initialize-PSPetstoreApiResponse -Code null `
-Type null `
-Message null
```
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$ApiResponse | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreCategory -Id null `
$Category = Initialize-PSPetstoreCategory -Id null `
-Name null
```
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$Category | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreInlineObject -Name null `
$InlineObject = Initialize-PSPetstoreInlineObject -Name null `
-Status null
```
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$InlineObject | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null `
$InlineObject1 = Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null `
-File null
```
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$InlineObject1 | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreOrder -Id null `
$Order = Initialize-PSPetstoreOrder -Id null `
-PetId null `
-Quantity null `
-ShipDate null `
@ -24,7 +24,7 @@ Initialize-PSPetstoreOrder -Id null `
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$Order | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -29,11 +29,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
# Add a new pet to the store
try {
Pet $Result = Add-PSPet -Pet $Pet
$Result = Add-PSPet -Pet $Pet
} catch {
Write-Host ("Exception occured when calling Add-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -47,7 +48,7 @@ Name | Type | Description | Notes
**Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md)
### Authorization
@ -77,12 +78,13 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | Pet id to delete
$ApiKey = "ApiKey_example" # String | (optional)
# Deletes a pet
try {
Remove-Pet -PetId $PetId -ApiKey $ApiKey
$Result = Remove-Pet -PetId $PetId -ApiKey $ApiKey
} catch {
Write-Host ("Exception occured when calling Remove-Pet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -97,7 +99,7 @@ Name | Type | Description | Notes
**ApiKey** | **String**| | [optional]
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -128,11 +130,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Status = @("Status_example") # String[] | Status values that need to be considered for filter
# Finds Pets by status
try {
Pet[] $Result = Find-PSPetsByStatus -Status $Status
$Result = Find-PSPetsByStatus -Status $Status
} catch {
Write-Host ("Exception occured when calling Find-PSPetsByStatus: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -146,7 +149,7 @@ Name | Type | Description | Notes
**Status** | [**String[]**](String.md)| Status values that need to be considered for filter |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet[]**](Pet.md)
### Authorization
@ -177,11 +180,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Tags = @("Inner_example") # String[] | Tags to filter by
# Finds Pets by tags
try {
Pet[] $Result = Find-PSPetsByTags -Tags $Tags
$Result = Find-PSPetsByTags -Tags $Tags
} catch {
Write-Host ("Exception occured when calling Find-PSPetsByTags: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -195,7 +199,7 @@ Name | Type | Description | Notes
**Tags** | [**String[]**](String.md)| Tags to filter by |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet[]**](Pet.md)
### Authorization
@ -228,11 +232,12 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
$PetId = 987 # Int64 | ID of pet to return
# Find pet by ID
try {
Pet $Result = Get-PSPetById -PetId $PetId
$Result = Get-PSPetById -PetId $PetId
} catch {
Write-Host ("Exception occured when calling Get-PSPetById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -246,7 +251,7 @@ Name | Type | Description | Notes
**PetId** | **Int64**| ID of pet to return |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md)
### Authorization
@ -275,11 +280,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
# Update an existing pet
try {
Pet $Result = Update-PSPet -Pet $Pet
$Result = Update-PSPet -Pet $Pet
} catch {
Write-Host ("Exception occured when calling Update-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -293,7 +299,7 @@ Name | Type | Description | Notes
**Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md)
### Authorization
@ -324,13 +330,14 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet that needs to be updated
$Name = "Name_example" # String | Updated name of the pet (optional)
$Status = "Status_example" # String | Updated status of the pet (optional)
# Updates a pet in the store with form data
try {
Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status
$Result = Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status
} catch {
Write-Host ("Exception occured when calling Update-PSPetWithForm: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -346,7 +353,7 @@ Name | Type | Description | Notes
**Status** | **String**| Updated status of the pet | [optional]
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -377,13 +384,14 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet to update
$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional)
$File = 987 # System.IO.FileInfo | file to upload (optional)
# uploads an image
try {
ApiResponse $Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File
$Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File
} catch {
Write-Host ("Exception occured when calling Invoke-PSUploadFile: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -399,7 +407,7 @@ Name | Type | Description | Notes
**File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional]
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**ApiResponse**](ApiResponse.md)
### Authorization

View File

@ -27,7 +27,7 @@ $OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
# Delete purchase order by ID
try {
Remove-PSOrder -OrderId $OrderId
$Result = Remove-PSOrder -OrderId $OrderId
} catch {
Write-Host ("Exception occured when calling Remove-PSOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -41,7 +41,7 @@ Name | Type | Description | Notes
**OrderId** | **String**| ID of the order that needs to be deleted |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -74,9 +74,10 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
# Returns pet inventories by status
try {
System.Collections.Hashtable $Result = Get-PSInventory
$Result = Get-PSInventory
} catch {
Write-Host ("Exception occured when calling Get-PSInventory: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -87,7 +88,7 @@ try {
This endpoint does not need any parameter.
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
**System.Collections.Hashtable**
### Authorization
@ -118,7 +119,7 @@ $OrderId = 987 # Int64 | ID of pet that needs to be fetched
# Find purchase order by ID
try {
Order $Result = Get-PSOrderById -OrderId $OrderId
$Result = Get-PSOrderById -OrderId $OrderId
} catch {
Write-Host ("Exception occured when calling Get-PSOrderById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -132,7 +133,7 @@ Name | Type | Description | Notes
**OrderId** | **Int64**| ID of pet that needs to be fetched |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Order**](Order.md)
### Authorization
@ -161,7 +162,7 @@ $Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -S
# Place an order for a pet
try {
Order $Result = Invoke-PSPlaceOrder -Order $Order
$Result = Invoke-PSPlaceOrder -Order $Order
} catch {
Write-Host ("Exception occured when calling Invoke-PSPlaceOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -175,7 +176,7 @@ Name | Type | Description | Notes
**Order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Order**](Order.md)
### Authorization

View File

@ -33,11 +33,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object
# Create user
try {
New-PSUser -User $User
$Result = New-PSUser -User $User
} catch {
Write-Host ("Exception occured when calling New-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -51,7 +52,7 @@ Name | Type | Description | Notes
**User** | [**User**](User.md)| Created user object |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -82,11 +83,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object
# Creates list of users with given input array
try {
New-PSUsersWithArrayInput -User $User
$Result = New-PSUsersWithArrayInput -User $User
} catch {
Write-Host ("Exception occured when calling New-PSUsersWithArrayInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -100,7 +102,7 @@ Name | Type | Description | Notes
**User** | [**User[]**](User.md)| List of user object |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -131,11 +133,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = @() # User[] | List of user object
# Creates list of users with given input array
try {
New-PSUsersWithListInput -User $User
$Result = New-PSUsersWithListInput -User $User
} catch {
Write-Host ("Exception occured when calling New-PSUsersWithListInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -149,7 +152,7 @@ Name | Type | Description | Notes
**User** | [**User[]**](User.md)| List of user object |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -182,11 +185,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | The name that needs to be deleted
# Delete user
try {
Remove-PSUser -Username $Username
$Result = Remove-PSUser -Username $Username
} catch {
Write-Host ("Exception occured when calling Remove-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -200,7 +204,7 @@ Name | Type | Description | Notes
**Username** | **String**| The name that needs to be deleted |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -229,7 +233,7 @@ $Username = "Username_example" # String | The name that needs to be fetched. Use
# Get user by user name
try {
User $Result = Get-PSUserByName -Username $Username
$Result = Get-PSUserByName -Username $Username
} catch {
Write-Host ("Exception occured when calling Get-PSUserByName: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -243,7 +247,7 @@ Name | Type | Description | Notes
**Username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**User**](User.md)
### Authorization
@ -274,7 +278,7 @@ $Password = "Password_example" # String | The password for login in clear text
# Logs user into the system
try {
String $Result = Invoke-PSLoginUser -Username $Username -Password $Password
$Result = Invoke-PSLoginUser -Username $Username -Password $Password
} catch {
Write-Host ("Exception occured when calling Invoke-PSLoginUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -289,7 +293,7 @@ Name | Type | Description | Notes
**Password** | **String**| The password for login in clear text |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
**String**
### Authorization
@ -320,9 +324,10 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
# Logs out current logged in user session
try {
Invoke-PSLogoutUser
$Result = Invoke-PSLogoutUser
} catch {
Write-Host ("Exception occured when calling Invoke-PSLogoutUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -333,7 +338,7 @@ try {
This endpoint does not need any parameter.
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization
@ -367,12 +372,13 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | name that need to be deleted
$User = # User | Updated user object
# Updated user
try {
Update-PSUser -Username $Username -User $User
$Result = Update-PSUser -Username $Username -User $User
} catch {
Write-Host ("Exception occured when calling Update-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -387,7 +393,7 @@ Name | Type | Description | Notes
**User** | [**User**](User.md)| Updated user object |
### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body)
### Authorization

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstorePet -Id null `
$Pet = Initialize-PSPetstorePet -Id null `
-Category null `
-Name doggie `
-PhotoUrls null `
@ -24,7 +24,7 @@ Initialize-PSPetstorePet -Id null `
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$Pet | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreTag -Id null `
$Tag = Initialize-PSPetstoreTag -Id null `
-Name null
```
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$Tag | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Name | Type | Description | Notes
- Prepare the resource
```powershell
Initialize-PSPetstoreUser -Id null `
$User = Initialize-PSPetstoreUser -Id null `
-Username null `
-FirstName null `
-LastName null `
@ -28,7 +28,7 @@ Initialize-PSPetstoreUser -Id null `
- Convert the resource to JSON
```powershell
$ | Convert-ToJSON
$User | ConvertTo-JSON
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)