Previous Topic: dpmhv-ShowClusterSharedVolumes (Funclet) Command--Show all Cluster Shared VolumesNext Topic: dpmhv-ShowHosts (Funclet) Command--Show all Hyper-V Servers


dpmhv-ShowDirectories (Funclet) Command--Show all Directories

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

Specifies the name of the Hyper-V server host.

-dir dir

Specifies the name of the directory.

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

-detail

(Optional) Displays the details of the list of directories.

Return Value

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");