PowerShell Module: Advanced Guide

PowerShell Module: Advanced Guide

This feature is only available in the Nerdio Manager Premium edition.

The PowerShell Module for Nerdio Manager is a wrapper for the Nerdio Manager REST API. Certain “advanced” cmdlets require a JSON object to be passed as a parameter. This document explains one possible way to generate such JSON objects.

Note: The PowerShell Module for Nerdio Manager is in public preview. Please submit your feedback here.

Prerequisites

Install the PowerShell module. See PowerShell Module: Tutorial for details.

Create the Object

The following steps must be performed to create the object.

To create the object:

  1. Identify which cmdlet is required to complete the task (for example, New-NmeAppAttachImage).

  2. Run the Get-Help cmdlet:

    Get-Help New-NmeAppAttachImage -full

    Note: In this example, the cmdlet New-NmeAppAttachImage takes an object. The object itself is internal to Nerdio and can be generated via New-NmeAppAttachImageRestPostRequest.

  3. Run the command below to see the properties and to see the syntax for creating the object.

    Get-Help New-NmeAppAttachImageRestPostRequest -full

  4. Select one of the following options to get the values:

    • In the Nerdio Manager portal (for example, https://nmw-app-i55ow6qnxy6hc6-new.azurewebsites.net/app-attach/images)

    • Run the corresponding Get* cmdlet. (for example, Get -NmeAppAttachImage)

    • Create the payload object using the cmdlet and providing the values from the previous steps.

      $requestPayload = New-NmeAppAttachImageRestPostRequest

      -locationId 19bccd18-cbec-4c61-f71c-71db34322vc50f

      -imageName "test-image"

      -description "test-image from PS"

  5. Create a new image by passing the payload request.

    New-NmeAppAttachImage -NmeAppAttachImageRestPostRequest $requestPayload

  6. Run Get-NmeAppAttachImage to confirm the outcome.

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Article is closed for comments.