The dpmhv-ShowDirectories command displays all subdirectories under a specified directory within a system. The specified system can be Hyper-V server or a Windows system with remote WMI enabled.
This command has the following format:
dpmhv-showDirectories -host hostname -dir dir [-retval] [-silent] [-detail]
Specifies the name of the Hyper-V server host.
Specifies the name of the directory.
Returns a value for further processing.
Specifies not to direct the output to the screen.
(Optional) Displays the details of the list of directories.
The dpmhv-ShowDirectories command returns an array of objects which represents a subdirectory under the specified parent directory.
The following properties are returned in regular mode:
Example: Show all Directories
This example displays the subdirectories under the root directory (c: drive) of the host hvserver.
dpmhv-showDirectories -host hvserver -dir c:\
Example: Show all Directories under Program Files
This example displays the subdirectories of "C:\Program Files".
function walkDir(sPath) { dirs = dpmhv-showDirectories -host hvserver -dir (sPath) -retval -silent for each (subdir in dirs) { ? subdir.Name walkDir(subdir.Name); } } walkDir("C:\Program Files");
Copyright © 2013 CA. All rights reserved. |
|