Skip to content

Set SdnResource

Adam Rudell edited this page Sep 8, 2025 · 3 revisions

Set-SdnResource

SYNOPSIS

Invokes a web request to SDN API for the requested resource.

SYNTAX

Resource

Set-SdnResource -NcUri <Uri> -Resource <SdnApiResource> -ResourceId <String> [-OperationType <String>]
 [-Object <Object>] [-ApiVersion <String>] [-NcRestCredential <PSCredential>]
 [-NcRestCertificate <X509Certificate>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

ResourceRef

Set-SdnResource -NcUri <Uri> -ResourceRef <String> [-OperationType <String>] [-Object <Object>]
 [-ApiVersion <String>] [-NcRestCredential <PSCredential>] [-NcRestCertificate <X509Certificate>]
 [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

EXAMPLE 1

Set-SdnResource -NcUri "https://nc.$env:USERDNSDOMAIN" -ResourceRef "/networkInterfaces/contoso-nic1" -Object $object

EXAMPLE 2

Set-SdnResource -NcUri "https://nc.$env:USERDNSDOMAIN" -Resource "networkInterfaces" -ResourceId "contoso-nic1" -Object $object

EXAMPLE 3

Set-SdnResource -NcUri "https://nc.$env:USERDNSDOMAIN" -Resource "networkInterfaces" -ResourceId "contoso-nic1" -OperationType "Delete"

PARAMETERS

-NcUri

Specifies the Uniform Resource Identifier (URI) of the network controller that all Representational State Transfer (REST) clients use to connect to that controller.

Type: Uri
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ResourceRef

The resource ref of the object you want to perform the operation against.

Type: String
Parameter Sets: ResourceRef
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Resource

The resource type you want to perform the operation against.

Type: SdnApiResource
Parameter Sets: Resource
Aliases:
Accepted values: AccessControlLists, AuditingSettingsConfig, Credentials, Discovery, GatewayPools, Gateways, IDNSServerConfig, LearnedIPAddresses, LoadBalancerManagerConfig, LoadBalancerMuxes, LoadBalancers, LogicalNetworks, MacPools, NetworkControllerBackup, NetworkControllerRestore, NetworkControllerStatistics, NetworkInterfaces, Operations, OperationResults, PublicIPAddresses, SecurityTags, Servers, ServiceInsertions, RouteTables, VirtualGateways, VirtualNetworkManagerConfig, VirtualNetworks, VirtualServers, VirtualSwitchManagerConfig

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ResourceId

Specify the unique ID of the resource.

Type: String
Parameter Sets: Resource
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OperationType

Specify the operation type to perform on the resource (Add or Update or Delete).

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Update
Accept pipeline input: False
Accept wildcard characters: False

-Object

The object that represents the resource to be created or updated. This parameter is required for Add and Update operations.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ApiVersion

The API version to use when invoking against the NC REST API endpoint.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $Global:SdnDiagnostics.EnvironmentInfo.RestApiVersion
Accept pipeline input: False
Accept wildcard characters: False

-NcRestCredential

Specifies a user account that has permission to perform this action against the Network Controller REST API. The default is the current user.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [System.Management.Automation.PSCredential]::Empty
Accept pipeline input: False
Accept wildcard characters: False

-NcRestCertificate

Specifies the client certificate that is used for a secure web request to Network Controller REST API. Enter a variable that contains a certificate or a command or expression that gets the certificate.

Type: X509Certificate
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

Documentation

How To Guides:

Troubleshooting Guides

Learning

Functions

Clone this wiki locally