none
.Net for windows administrator RRS feed

  • Question

  • I want to learn .Net to be used with powershell for windows administration. Is there any book which goes deep into using .Net classes with powershell for system administration?
    Friday, November 8, 2019 3:49 PM

Answers

All replies

  • I recommend that you search amazon or other publishers for books on Administration with PowerShell.

    Start by learning PowerShell which will take some time.  There are thousands of Net classes so you will not find any summary like you are asking for.

    If you learn PowerShell the use of Net will become clear and you will be able to use other resources to solve your issues.


    \_(ツ)_/

    Friday, November 8, 2019 4:58 PM
    Moderator
  • Powershell is definitely a good window into it.  And there's a lot you can discover with tab completion of the different types and the static and instance methods.  And if you run a method without the parentheses, it will show you all the overload definitions.

    Friday, November 8, 2019 6:40 PM
  • What is it you're actually trying to do though?  Or learn?

    .NET is great to learn, and you'll understand PowerShell more deeply, but don't assume, if you can't find a cmdlet to do some task, that you'll find a .NET class that can actually do it.

    Friday, November 8, 2019 6:51 PM
  • Basically when I search for the .Net class, I get a list of constructors, however I don't see example on how to use those constructors like there are examples given in the powershell help with explanation. Is there any help system for .Net similar to powershell where I can look for examples and detailed help for the System classes? 
    Saturday, November 9, 2019 2:04 AM
  • The class definition and constructor definition is all you need. The issue is that you do not understand programming. Net docs are API documentation. It is a hierarchy of def9inition.

    If you ask a specific question about a specific constructor then I can give you an example of how it works. 

    For all arguments defined for a constructor their are links to the "type" for the argument.  The type returned from the constructors is an object instance of that class.

    Here is where to start to get background on OOP (Object Oriented Programming) and object systems: https://en.wikipedia.org/wiki/Object-oriented_programming


    \_(ツ)_/

    Saturday, November 9, 2019 3:27 AM
    Moderator
  • If you follow a link for a constructor, you'll get an example, but it's in C#.  There are similarities to Powershell.
    Saturday, November 9, 2019 3:38 AM
  • If you follow a link for a constructor, you'll get an example, but it's in C#.  There are similarities to Powershell.

    Wish it was true but many constructors have no examples. The docs are constantly improving. Examples can be had much of the time by searching like this: 

    https://csharp.hotexamples.com/examples/-/DirectoryEntry/-/php-directoryentry-class-examples.html


    \_(ツ)_/

    • Marked as answer by Admin66 Saturday, November 9, 2019 6:37 AM
    Saturday, November 9, 2019 3:43 AM
    Moderator
  • Thanks jrv. I will go through the link given.
    Saturday, November 9, 2019 6:37 AM
  • TO search use this method:

    "c# System.DirectoryServices.DirectorySearcher"

    or

    "powershell System.DirectoryServices.DirectorySearcher"

    caps not necessary.

    Example:

    powershell System.DirectoryServices.DirectorySearcher


    \_(ツ)_/

    Saturday, November 9, 2019 6:43 AM
    Moderator