Changes

Jump to: navigation, search

Working with File Systems in Windows PowerShell 1.0

1,086 bytes added, 14:45, 8 December 2008
Creating New Windows PowerShell Drives
PS C:\Users\Administrator> get-content tmpfiles:test.txt
This is a test
</pre>
 
== Getting Information About Network Drives in PowerShell ==
 
In addition to obtaining information about disk drives attached to the local system, it is also possible to get information about mapped network drives from within Windows PowerShell. This is achieved by accessing the WMI win32_mappedlogicaldisk object. As with most object, this one provides a wealth of information so it is often best to select only those attributes which are specifically needed. The following command, for example, displays the device ID, the name of the remote server on which the disk is physically located and the amount of remaining free space on the particular drive:
 
<pre>
PS C:\Users\Administrator> get-wmiobject win32_mappedlogicaldisk | select-object deviceid,providername,freespace
 
deviceid providername freespace
-------- ------------ ---------
Z: \\Winserver-2\c 9408192512
</pre>

Navigation menu