I m not from programming / coding background, but after learning and using PS, I just fall in love of coding. I found that I m good at coding. My brain process codes more faster. But the limitation is I know only powershell. Whenever I m looking for solutions in forums, I used to see people use classes and methods, type accelerators etc. I also use those when I see how peole use it. Yes, its true I m not able to use them at one chance, I have to look for more and more information using multiple forum, then I can figure out something.
Now my question to you is, I want to learn these things. I know PS use dot net framework, but I can’t find the point from where I should start. I think if I can learn the framework, I can do more better. Could you please guide me how should I proceed?
There are a few books you should consider getting.
PowerShell Month Of Lunches & PowerShell Scripting Month of Lunches
those are a great start, but I have a personal favorite module that I’ve been using called ‘PSKoans’, give that a shot and you’ll start learning a lot more quickly by example.
“Learning the framework” is a very, very broad thing indeed. There’s enough in there to last a few lifetimes, I’m sure. Not all of it will be useful to your purposes specifically, as there are a lot of specialized tools.
I’ve found it actually a bit easier to look for information on how to do things in other languages that have a more direct interaction with .NET framework on occasion, and then translating that to how it can be used in PowerShell. C# is pretty close to PowerShell in terms of syntax in most cases, so if I can’t find a cmdlet for it, I’ll often look to see if there are existing solutions or tools that are recommended for C#, and then port that to PowerShell. That said, examples of how to do things purely in PS are getting quite a bit more common.
PowerShell is often referred to as a gateway drug to C#, so, jump on that band wagon.
Get ramped up on PowerShell classes, well, classes in general.
YouTube - by Trevor Sullivan
https://www.youtube.com/results?search_query=PowerShell+classes+Trevor+sullivan
Dig at the namespaces and the like. Start here:
<#
Get any .NET types and their static methods from PowerShell.
Enumerate all that are currently loaded into your AppDomain.
#>
[AppDomain]::CurrentDomain.GetAssemblies() |
foreach { $_.GetTypes() } |
foreach { $_.GetMethods() } |
where { $_.IsStatic } |
select DeclaringType, Name |
Out-GridView -PassThru -Title '.NET types and their static methods'