Set-WssDrive

Set-WssDrive

Changes drive name or whether to enable snapshots.

Syntax

Parameter Set: ByNameParamSet
Set-WssDrive [-Name] <String> [[-NewName] <String> ] [[-SnapshotsEnabled] <Boolean> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByIdParamSet
Set-WssDrive [-ID] <Guid> [[-NewName] <String> ] [[-SnapshotsEnabled] <Boolean> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByObjectParamSet
Set-WssDrive [-Drive] <Drive> [[-NewName] <String> ] [[-SnapshotsEnabled] <Boolean> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-WssDrive cmdlet changes the name of a drive or whether to enable snapshots for a drive. You can specify a drive by using its name or its GUID, or you can use the Get-WssDrive cmdlet to obtain a Drive object. To specify a new drive name, use the NewName parameter. To specify whether to enable snapshots, use the SnapShotsEnabled parameter.

Parameters

-Drive<Drive>

Specifies a Drive object. To obtain a Drive object, use the Get-WssDrive cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ID<Guid>

Specifies the GUID of a drive.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a drive.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NewName<String>

Specifies a new name for the drive.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SnapshotsEnabled<Boolean>

Indicates whether to enable snapshots on the drive.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Drive

Examples

Example 1: Change the name of a drive

This example renames a drive. The first command uses the Get-WssDrive cmdlet to get a Drive object that has the specified GUID, and stores it in the $Drive variable.

The second command changes the name of the drive represented by the object stored in the $Drive variable to Sarah Jones Volume.

PS C:\> $Drive = Get-WssDrive -ID b6b093a2-1860-4172-a4a5-07ce2aebfa13
PS C:\> Set-WssDrive -Drive $Drive -NewName "Sarah Jones Volume"

Get-WssDrive

Test-WssDrive