Get-SCDirectoryChildItem

Get-SCDirectoryChildItem

Gets all files and subdirectories in the specified directory on a virtual machine host or on a library server managed by VMM.

構文

Parameter Set: FromLibraryServer
Get-SCDirectoryChildItem -LibraryServer <LibraryServer> -Path <String> [ <CommonParameters>]

Parameter Set: FromVMHost
Get-SCDirectoryChildItem -Path <String> -VMHost <Host> [ <CommonParameters>]

詳細説明

The Get-SCDirectoryChildItem cmdlet gets all files and subdirectories immediately under the specified directory on a virtual machine host or on a library server managed by Virtual Machine Manager (VMM). If you specify a share path, such as \\ServerName\ShareName\Directory\FileName, the subdirectories of the share path are returned.

If you use the Get-SCDirectoryChildItem cmdlet to retrieve files and subdirectories on a library server, you must specify a path to a valid library share. For example, the share path to the default library share installed by Setup when you first install VMM is: \\VMMServerName.DomainName.com\MSSCVMMLibrary.

パラメーター

-LibraryServer<LibraryServer>

Specifies a VMM library server object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

True (ByValue)

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

false

-Path<String>

Specifies the destination path for the operation.

Example formats:

Local: -Path "F:\"

UNC: -Path "\\Library\Templates"

Volume GUID: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"

VMware ESX: -Path "[storage1]\MyVMwareFolderForVMs\MyVM.vmx"

Citrix XenServer: -Path "Local storage[99b6212f-b63d-c676-25f9-d6c460992de7]"

Wildcards are supported for Get- cmdlets and when you specify the UNC path.

Example format:

UNC: -Path "\\VMHostServer\MyVMs\*VM*"

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-VMHost<Host>

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, type Get-Help Add-SCVMHost -detailed. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

True (ByValue)

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

false

<CommonParameters>

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

入力

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

出力

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

  • VMHostFileInformation

Example 1: Get the files and subdirectories for the specified path on a VMM host

The first command gets the host object named VMHost01 from the VMM database, and then stores the object in the $VMHost variable.

The second command displays the name and other information about each file and subdirectory immediately under the C:\ drive on VMHost01.

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01"
PS C:\> Get-SCDirectoryChildItem -VMHost $VMHost -Path "C:\" 

Example Example 2: Get the subdirectories for the specified path on a library server.

The first command gets the library server object named FileServer01 from VMMServer01 and stores the object in the $LibServ variable.

The second command displays the name, parent directory, and other information about each file stored in the directory for the default library share on FileServer01. You must specify the complete path to the library share.

Note: This example assumes that the default VMM library share, MSSCVMMLibrary, is used in your environment. To get the names of library shares, type Get-SCLibraryShare | select Name.

PS C:\> $LibServ = Get-SCLibraryServer -VMMServer "VMMServer01.Contoso.com" -ComputerName "FileServer01.Contoso.com"
PS C:\> Get-SCDirectoryChildItem -LibraryServer $LibServ -Path "\\FileServer01.Contoso.com\MSSCVMMLibrary"

関連トピック

Get-SCLibraryServer

Get-SCVMHost