我開始自己學習PowerShell。在其中一本書中(Windows Server R2,實施和維護),我得到了必須創建腳本的任務,該腳本在運行後將在新創建的vdisc上創建存儲池,虛擬光盤和新共享。提供池,虛擬光盤和共享
基於指令書這就是我所做的已經:
New-StoragePool -FriendlyName "Pool" -StorageSubSystemFriendlyName (Get-StorageSubSystem).FriendlyName -PhysicalDisk (Get-PhysicalDisk | where CanPool -eq True) -ProvisingTypeDefault Thin -ResiliencySettingNameDefault Mirror
New-VirtualDisk -FriendlyName "vDisk1" -StoragePoolFriendlyName "Pool" -Size 5TB
New-VirtualDisk -FriendlyName "vDisk2" -StoragePoolFriendlyName "Pool" -Size 10TB
New Partition -DiskNumber(Get-Disk | where BusType -eq Spaces).Number -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem NTFS -Confirm:$false
現在我想通過New-Item
功能來創建新創建的虛擬磁盤共享文件夾。問題是我不知道如何爲多個磁盤創建路徑,而且參數-AssignDriveLetter
從New Partition
自動創建驅動器號。因爲我不知道驅動器號。因此我不知道如何在New-Item
中設置變量Path
。
這是用於Hyper-V的嗎? –
嗨,是的服務器上的Hyper-V –
在超v我設置了2個physicall光盤(這是離線) –