# How did you learn to type-out & reason through scripting language?

**URL:** <https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959>\
**Category:** Training Resources\
**Created:** [March 13, 2021, 3:54pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959 "2021-03-13T15:54:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeeMossRun](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@SeeMossRun](https://forums.powershell.org/u/SeeMossRun)\
**Post date:** [March 13, 2021, 3:54pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/1 "2021-03-13T15:54:44Z")

</div>

h3110! I’m an auto-did-act learning how to USE and OPERATE computers like a computer science major would. Ok, here’s my “screed”: I never went to high school, and long story short → I need to learn how to read and reason through scripting language, programming-style structures and command syntax (with the goal of Systems/Network Admin). I’m currently reading books with words like, “beginner” in the title but inside the authors are using terminology, commands and coding I have never seen/heard. An excellent example is the book, “C Programming: Absolute Beginner’s Guide.” Also, _many_ online searches have yielded no results for books that start at the _ **v e r y** _ beginning! I’m familiar with many words and basic CS concepts. I’m almost done going through “PowerShell in Depth”, 2nd ed., by JONES, HICKS & SIDDAWAY, picking out everything fundamental and basic.

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [March 14, 2021, 5:39pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/2 "2021-03-14T17:39:24Z")

</div>

Welcome to the forums 👋

So even as folks with some experience, we constantly see terminology, commands, and code that we’ve never seen before. One of the best (and sometimes one of the most daunting) things about working in IT is that it’s not possible to know it all. In fact, things now progress so fast that it’s very difficult to know everything in even specific areas.

Honestly, focussing on programming in and of itself is not going to get to you to your goal of becoming a systems or network admin. Understanding some of the basic concepts such a loops, functions, strings, conditional statements etc. will help you write better scripts but the kind of things you’ll learn about on a CS programming course: abstraction, inheritence, coupling, cohesion, polymorphism etc. are not things that the average systems administrator is thinking about when scripting.

If your goal is to become a sysadmin or network admin (each different disciplines in their own right) I would consider looking at the learning paths of some of the big vendors. This will give you some idea of the careers available and the technical knowledge required to pursue them.

Whichever path you choose, learning is no substitute for experience. If you’re not already working in a junior role, you can gain some of that experience by building a homelab or making use of Azure or AWS (both offer free tiers) to play with real servers.

Resources:

> **[bootcamp - sysadmin](https://www.reddit.com/r/sysadmin/wiki/bootcamp/)**
>
> r/sysadmin: A reddit dedicated to the profession of Computer System Administration.

> **[Microsoft Learn](https://docs.microsoft.com/en-us/learn/)**
>
> The skills required to advance your career and earn your spot at the top do not come easily. Now there’s a more rewarding approach to hands-on learning that helps you achieve your goals faster. Earn points, levels, and achieve more!

> **[Create Your Azure Free Account Today | Microsoft Azure](https://azure.microsoft.com/en-gb/free/)**
>
> Get started with 12 months of free services, 40+ services that are always free, and USD200 in credit. Create your free account today with Microsoft Azure.

> **[What is a “Dev Tenant” and why would you want one?](https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/what-is-a-dev-tenant-and-why-would-you-want-one/ba-p/2036610)**
>
> When someone says to you, they are using their “dev tenant” what they’re probably referring to is their personal development “sandbox” they received as part of joining the Microsoft 365 developer program.         By visiting...

> **[Certifications - Training & Certifications](https://www.cisco.com/c/en/us/training-events/training-certifications/certifications.html#~certifications)**
>
> We offer five levels of network certification: Entry, Associate, Professional, Expert and Architect, the highest level of accreditation within the Cisco Career Certification program.

> **[Cisco Packet Tracer](https://www.netacad.com/courses/packet-tracer)**
>
> Enroll, download, and get started learning valuable tips and best practices for using the latest version of Packet Tracer with our brief introductory course.

> **[Certification](https://www.vmware.com/learning/certification.html)**
>
> VMware Certification provides industry leading programs that demonstrate your knowledge, skills, and expertise to your employers, colleagues, and customers.

> **[Learn about Training by Role or Solution | Digital and Classroom Training | AWS](https://aws.amazon.com/training/learn-about/)**
>
> Advance your skills and prepare to use the AWS Cloud with help from AWS Training and Certification. Explore learning opportunities grouped by your role, by your solutions area, or by your AWS Partner needs. We offer digital training courses,...

> **[Free Cloud Computing Services - AWS Free Tier](https://aws.amazon.com/free/)**
>
> Gain hands-on experience with the AWS platform, products, and services for free with the AWS Free Tier offerings. Browse 100 offerings for AWS free tier services.

> **[Linux+ (Plus) Certification | CompTIA IT Certifications](https://www.comptia.org/certifications/linux)**
>
> Linux+ validates the skills needed for an early career Linux system administrator. Learn about the certification, available training and the exam.

---

<div class="post-metadata">

**Author:** ![SeeMossRun](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@SeeMossRun](https://forums.powershell.org/u/SeeMossRun)\
**Post date:** [March 15, 2021, 11:22pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/3 "2021-03-15T23:22:28Z")

</div>

Thank you matt-bloomfield!

I will carefully go through those links. In the mean time, it appears you latched on to the least-important point of my post → how I can I understand & reason through this?"↓

```auto
Param ([string]$ComputerName=$env:COMPUTERNAME)
New-Variable -Name ADS_UF_DONT_EXPIRE_PASSWD -Value 0x10000 -Option Constant
[ADSI]$server="WinNT://$computername"
$users=$server.children | where {$_.schemaclassname -eq "user"}
foreach ($user in $users) {  
   if ($user.userflags.value -band $ADS_UF_DONT_EXPIRE_PASSWD) {          
       $pwdNeverExpires=$True
  }
  else {
        $pwdNeverExpires=$False
  }
  New-Object -TypeName PSObject -Property @{
    Computername=$server.name.value
    Username=$User.name.value
    PasswordNeverExpires=$pwdNeverExpires
  }
}

```

I can name a couple of these segments and some of the syntax . . . what I’m trying to get at is where did you all learn how to read this and reason through it? I doubt very much any Microsoft learning program is going to go that far back in CS knowledge.

[The block indentations didn’t get rendered in the post!]

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 15, 2021, 11:34pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/4 "2021-03-15T23:34:11Z")

</div>

> [@SeeMossRun](#):
>
> [The block indentations didn’t get rendered in the post!]

You have to format it as code! 😉

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [March 16, 2021, 9:49am UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/5 "2021-03-16T09:49:42Z")

</div>

Although part 1 of PowerShell in Depth covers the fundamentals. The best beginner’s guide to PowerShell is [Learn Windows PowerShell in a Month of Lunches](https://www.manning.com/books/learn-windows-powershell-in-a-month-of-lunches-third-edition)

That book and learning how to use the PowerShell help system, together with writing your own code is what really helps when trying to understand other people’s code.

---

<div class="post-metadata">

**Author:** ![saine](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@saine](https://forums.powershell.org/u/saine)\
**Post date:** [March 21, 2021, 3:29pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/6 "2021-03-21T15:29:08Z")

</div>

i hope here are enough keywords to search. Most of it is in the official documentation

```powershell
# The Parameter Block. You define your params here
Param (
    # A Param 'ComputerName' with a default value of the environment Var 
    # 'ComputerName'. The 'string' is to make sure the value is a string
    [string]$ComputerName = $env:COMPUTERNAME
)

# A new Variable. 'Constant' is to make sure you cannot change the value.
New-Variable -Name ADS_UF_DONT_EXPIRE_PASSWD -Value 0x10000 -Option Constant

# Another new Variable 'ADSI' is an accelerator for
# 'System.DirectoryServices.DirectoryEntry' and it's there to make sure the Value
# inside 'Servers' is of that type.
[ADSI]$server = "WinNT://$computername"

# The Result is assignet to 'users'. Another new Variable
$users = $server.children | Where-Object { $_.schemaclassname -eq 'user' }

foreach ($user in $users) {
    # -band stands for 'binary and'
    if ( $user.userflags.value -band $ADS_UF_DONT_EXPIRE_PASSWD ) {          
        $pwdNeverExpires = $True
    }
    else {
        $pwdNeverExpires = $False
    }
    
    # creates a new Object of type PSObject and drops it into the pipeline
    # the Parameter Property takes a hashtable.
    # I wouldn't do it this way
    New-Object -TypeName PSObject -Property @{
        Computername = $server.name.value
        Username = $User.name.value
        PasswordNeverExpires = $pwdNeverExpires
    }
}

```

to the initial question. It’s just brute force. Either you dissect everything and google the heck out of it. Or you move on to the next code.  
Read Code. Write Code. Read Code. Write Code.  
And always ask “WHY?”, or “HOW?”. Way to many IT People stopped to ask that.

---

<div class="post-metadata">

**Author:** ![metablaster](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/metablaster/32/1224_2.png) [@metablaster](https://forums.powershell.org/u/metablaster)\
**Post date:** [April 13, 2021, 5:13pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/7 "2021-04-13T17:13:12Z")

</div>

You issue is, “ **how do I read code other people write? the syntax is alien to me…** ”

It’s rather easy, first and most core step in your example, is to learn about advanced functions because all of this also applies to scripts that are not functions:

[about\_Functions\_CmdletBindingAttribute - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_cmdletbindingattribute?view=powershell-7)

[about\_Functions\_Advanced\_Parameters - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7)

[about\_Functions\_Advanced\_Methods - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_methods?view=powershell-7)

Once you grasp those 3 links in detail with exercise, the only issue that remains while reading someones else code is code style.

Not everybody has same style, some people make it particularly hard to read, and to get around this you have to develop your own writing style first, because in doing so you’ll immediately differentiate “bad” syntax from language specific syntax.

Which means you can then focus on relevant (language syntax) rather than code style (someones else writing style)

> I doubt very much any Microsoft learning program is going to go that far back in CS knowledge

I personally doubt any book is going to teach better than MS docs and various code samples online, but this is just personal preference which I recommend anyone to addopt.

For example long time ago, I started learning C++ with books, and later discovered I wasted a lot of time reading bad books which only helped me in writing bad code.

Later, drilling trough good code samples online helped more because I was learning from someone who is writing real world code rather than someone selling books for profit as their primary reason for writing.

Of course this is slightly harder way to learn, but there are benefits too, you only need to make sure to choose small samples and find documentation that goes straight to the point you want to learn.

Following link may help to develop your own writing style:

[Introduction - PowerShell Practice and Style (gitbook.io)](https://poshcode.gitbook.io/powershell-practice-and-style/style-guide/introduction)

---

<div class="post-metadata">

**Author:** ![ShaunBlake](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/shaunblake/32/1273_2.png) [@ShaunBlake](https://forums.powershell.org/u/ShaunBlake)\
**Post date:** [May 6, 2021, 5:52pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/8 "2021-05-06T17:52:49Z")

</div>

> [@matt-bloomfield](#):
>
> **learning is no substitute for experience**

Aww, @matt-bloomfield, that is a _sublime_ aphorism!

---

<div class="post-metadata">

**Author:** ![ShaunBlake](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/shaunblake/32/1273_2.png) [@ShaunBlake](https://forums.powershell.org/u/ShaunBlake)\
**Post date:** [May 6, 2021, 6:08pm UTC](https://forums.powershell.org/t/how-did-you-learn-to-type-out-reason-through-scripting-language/15959/9 "2021-05-06T18:08:56Z")

</div>

> [@metablaster](#):
>
> learn about advanced functions because all of this also applies to scripts that are not functions:
> 
> [about\_Functions\_CmdletBindingAttribute - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_cmdletbindingattribute?view=powershell-7)
> 
> [about\_Functions\_Advanced\_Parameters - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7)
> 
> [about\_Functions\_Advanced\_Methods - PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_methods?view=powershell-7)
> 
> Once you grasp those 3 links in detail with exercise, the only issue that remains while reading someones else code is code style.

Great resources, @metablaster; thanks for the inspiration, and the links!

> [@metablaster](#):
>
> Following link may help to develop your own writing style:
> 
> [Introduction - PowerShell Practice and Style (gitbook.io)](https://poshcode.gitbook.io/powershell-practice-and-style/style-guide/introduction)

And that is an excellent style guide. (But it’s been a bit embarrassing to see some of the recommendations … if you get my drift. 🤭)
