Add-SCLibraryShare
Add-SCLibraryShare
Adds Windows shares on the file system of a library server to the VMM library as library shares.
構文
Parameter Set: Default
Add-SCLibraryShare [-SharePath] <String> [-AddDefaultResources] [-Credential <PSCredential> ] [-Description <String> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
詳細説明
The Add-SCLibraryShare cmdlet adds Windows shares on the file system of a library server to the Virtual Machine Manager (VMM) library as library shares.
Before you can add a library share to the VMM library, you must first create the share in the Windows file system. You can, for example, use Windows Explorer to create and share a folder that you want to add to the library.
If you create a Windows share at the same level as the default library share (MSSCVMMLibrary) created by VMM Setup or on a separate library server, use the Add-SCLibraryShare cmdlet to add that share to the VMM library.
If you create a Windows folder under the default VMM library share (MSSCVMMLibrary), VMM automatically scans the share, discovers all existing objects stored on that share that qualify as library objects, and adds the library objects to the library. However, you can use the Read-SCLibraryShare cmdlet to manually refresh that share and import its contents into the VMM library.
Note: Library resources that can be discovered only by the library refresher but not created by an administrator include virtual hard disks (Windows-based .vhd files, Citrix XenServer-based .vhd files or VMware-based .vmdk files), virtual floppy disks (Windows-based .vfd files or VMware-based .flp files), ISO images (.iso files), and scripts.
パラメーター
-AddDefaultResources
Indicates that the default resources for a library share are added.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Credential<PSCredential>
Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.
For more information about the PSCredential object, type Get-Help Get-Credential
.
For more information about Run As accounts, type Get-Help New-SCRunAsAccount
.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Description<String>
States a description for the specified object.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-JobGroup<Guid]>
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PROTipID<Guid]>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-SharePath<String>
Specifies a path to a valid library share on an existing library server that uses a Universal Naming Convention (UNC) path.
Example format: -SharePath "\\LibServer01\LibShare"
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-VMMServer<ServerConnection>
Specifies a VMM server object.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- LibraryShare
例
Example 1: Add a Windows share as a library share object to the VMM library
The first command connects to VMMServer01.
The second command adds a library share object to the library named AllVHDs, a Windows share located on LibraryServer01. This example assumes that LibraryServer01 is already a VMM library server.
PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> Add-SCLibraryShare -SharePath "\\LibraryServer01\AllVHDs"
Example 2: Add two Windows shares as library share objects to the VMM library
The first command connects to VMMServer1.
The second command stores the strings \\LibraryServer01\AllVHDs and \\LibraryServer01\AllSOs in the $SharePaths variable. This example assumes that LibraryServer01 is already a VMM library server.
The last command uses a Foreach statement to pass the two share names stored in $SharePaths to the Add-SCLibraryShare cmdlet, which adds each Windows share as a library share to VMM.
For more information about the standard Windows PowerShell Foreach statement, type: Get-Help about_ForEach
. The Foreach statement is not the same as the ForEach-Object cmdlet, which uses foreach as an alias.
PS C:\> Get-SCVMMServer -ComputerName "VMMServer01.Contoso.com"
PS C:\> $SharePaths = "\\LibraryServer01\AllVHDs", "\\LibraryServer01\AllISOs"
PS C:\> Foreach($SharePath in $SharePaths) { Add-SCLibraryShare -SharePath $SharePath }