Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell Members: explanation for Methods and Properties?

I am a newbie when it comes to PowerShell and come from a BASH background from long ago. PowerShell's built-in documentation and help on the web is pretty good, but one area where I keep stumbling is understanding Methods and Properties (are these called members/classes?). I know that I can see which Methods and Properties I can use by doing, as in example:

ls | get-member

How do .Exists, .Trim, .SubString, or .Split, etc. actually work?

like image 209
Vippy Avatar asked Dec 27 '22 06:12

Vippy


1 Answers

When you do Get-Member, you will see the TypeName, something like:

TypeName: System.IO.DirectoryInfo

You can search for that type and look at its members.

These are .NET framework objects and its members and properties, so you can make use of the extensive documentation at msdn.

For example this is the doc for DirectoryInfo: http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx

like image 161
manojlds Avatar answered Feb 22 '23 21:02

manojlds