Set-WssDrive

Set-WssDrive

Changes drive name or whether to enable snapshots.

構文

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>]

詳細説明

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.

パラメーター

-Drive<Drive>

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

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-Force

ユーザーの確認を求めずにコマンドを強制的に実行します。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ID<Guid>

Specifies the GUID of a drive.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of a drive.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-NewName<String>

Specifies a new name for the drive.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-SnapshotsEnabled<Boolean>

Indicates whether to enable snapshots on the drive.

エイリアス

なし

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • Microsoft.WindowsServerSolutions.Storage.Drive

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.WindowsServerSolutions.Storage.Drive

    This cmdlet generates an object that represents the modifies drive.

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