There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ModifyWorkspaceState with a CLI
The following code examples show how to use ModifyWorkspaceState.
- CLI
-
- AWS CLI
-
To modify the state of a WorkSpace
The following
modify-workspace-stateexample sets the state of the specified WorkSpace toADMIN_MAINTENANCE.aws workspaces modify-workspace-state \ --workspace-idws-dk1xzr417\ --workspace-stateADMIN_MAINTENANCEThis command produces no output.
For more information, see WorkSpace maintenance in the Amazon WorkSpaces Administration Guide.
-
For API details, see ModifyWorkspaceState
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This sample changes the state of the specified Workspace to Available
Edit-WKSWorkspaceState -WorkspaceId ws-w361s100v -Region us-west-2 -WorkspaceState AVAILABLE-
For API details, see ModifyWorkspaceState in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This sample changes the state of the specified Workspace to Available
Edit-WKSWorkspaceState -WorkspaceId ws-w361s100v -Region us-west-2 -WorkspaceState AVAILABLE-
For API details, see ModifyWorkspaceState in AWS Tools for PowerShell Cmdlet Reference (V5).
-