LarsH
LarsH

Reputation: 27994

Where can I find detailed reference info for object methods?

I'm writing a Powershell script. Cmdlets like Remove-Item are easy to find reference information for; you can type help Remove-item in PS.

However, in some cases, you would like to be able to use the $item.Delete() method instead of the Remove-Item cmdlet. E.g. I've read that's the way to delete files without having them go into the Recycle Bin first.

But how do we find detailed reference information about the file object's Delete method? The closest I've come is something like

PS C:\> dir E:\blue.html | Get-Member
   TypeName: System.IO.FileInfo

Name                      MemberType     Definition                                  
----                      ----------     ----------                                  
Mode                      CodeProperty   System.String Mode{get=Mode;}               
...
Delete                    Method         void Delete()       

which tells me that the FileInfo type has a Delete() method, and gives me its signature (no parameters, apparently). But where do I find out about the semantics of this method? E.g. does it really bypass Recycle Bin, always? If there are no parameters, is there no way to get it to remove a folder (-Recurse)? Etc.

Of course I'm really hoping for an online reference, rather than a link to a book I have to buy.

Upvotes: 0

Views: 39

Answers (1)

Alexis Coles
Alexis Coles

Reputation: 1317

Powershell is based on .net System.IO.FileInfo is a .net object and you can find all the documentation for it on MSDN.

https://msdn.microsoft.com/en-us/library/system.io.fileinfo(v=vs.110).aspx

Upvotes: 1

Related Questions