PowerShell for Windows Admins

Jul 30 2013   3:28PM GMT

drive letter functions



Posted by: Richard Siddaway
Tags:
PowerShell

Have you ever looked at the functions available to you in PowerShell?

Get-ChildItem function:

shows the list of functions currently available in your PowerShell session.

function: is a PowerShell drive. Other drives are available:

£ Get-PSDrive

Name Used (GB) Free (GB) Provider Root
—- ——— ——— ——– —-
Alias Alias
C 103.58 129.21 FileSystem C:\
Cert Certificate \
D .03 .06 FileSystem D:\
E FileSystem E:\
Env Environment
F FileSystem F:\
Function Function
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
Variable Variable
WSMan WSMan

These drives are created by PowerShell providers – functionality that exposes data stores as if they were file systems. Other providers include AD, SQL Server and IIS if you have those installed.

The function drive enables you to work directly with functions. You can view their details:

£ get-command c: | fl *

PSPath : Microsoft.PowerShell.Core\Function::C:
PSDrive : Function
PSProvider : Microsoft.PowerShell.Core\Function
PSIsContainer : False
HelpUri :
ScriptBlock : Set-Location C:
CmdletBinding : False
DefaultParameterSet :
Definition : Set-Location C:
Options : None
Description :
Verb :
Noun :
HelpFile : System.Management.Automation.dll-Help.xml
OutputType : {}
Name : C:
CommandType : Function
Visibility : Public
ModuleName :
Module :
RemotingCapability : PowerShell
Parameters : {}
ParameterSets : {}

In this case the information is minimal because all the function does is set your location to the c: drive.

The important part is that you can investigate functions as you will see later

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: