-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Concept]: Basics #366
[Concept]: Basics #366
Conversation
glaxxie
commented
Apr 9, 2024
- Basics for PowerShell : short history, introductions
- Concept exercise : classic lasagna exercise
- Extra: eternal links for related concepts mentioned
- Basics for PowerShell : short history, introductions - Concept exercise : classic lasagna exercise - Extra: eternal links for related concepted mentioned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much English nit picking and wording suggestions do you want?
concepts/basics/.meta/config.json
Outdated
@@ -0,0 +1,5 @@ | |||
{ | |||
"blurb": "PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never heard a shell described this way before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I lift this one straight from Wikipedia for a quick blurb 😆
concepts/basics/about.md
Outdated
|
||
### Constants | ||
|
||
Constants in PowerShell are read-only variables that can't be **removed** after defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies they can have their value changed, just not removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the read-only mention already addressed that? But yeah I could change the wording here
concepts/basics/about.md
Outdated
## Functions | ||
|
||
Functions in PowerShell are defined using the `function` keyword. | ||
Each function can have zero or more formal parameters in `()` parenthesis, followed by its own scope start with `{` and end with `}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each function can have zero or more formal parameters in `()` parenthesis, followed by its own scope start with `{` and end with `}`. | |
Each function can have zero or more formal parameters in `()` parenthesis, followed by its own scope start with `{` and end with `}`. |
|
||
`basics`: | ||
|
||
- function definition & `return` keyword |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- function definition & `return` keyword | |
- function definition and `return` keyword |
- single line comments | ||
- updating variable values | ||
- using functions | ||
- variables, variable assignment, & variable naming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- variables, variable assignment, & variable naming | |
- variables, variable assignment and variable naming |
Use of the Oxford comma should be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! I've left suggestions/comments mostly on the about.md
file, with the same comments applying to where about.md
overlaps with the introduction.md
files. Most of these are suggestions - so if they don't sound or feel right to you, please feel free to ignore them. Except for the change from Python --> Powershell in the config.json
. 😉 That you probably want to make. 😄
concepts/basics/about.md
Outdated
@@ -0,0 +1,88 @@ | |||
# About | |||
|
|||
PowerShell is a dynamically implicit typed (also support strongly typed variables) scripting language from Microsoft, mostly focus on task automation and confifuration management. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerShell is a dynamically implicit typed (also support strongly typed variables) scripting language from Microsoft, mostly focus on task automation and confifuration management. | |
PowerShell is a dynamic and implicitly typed (_but also supporting [strongly typed][strong typed] variables_) scripting language from Microsoft, mostly focused on task automation and configuration management. |
concepts/basics/about.md
Outdated
|
||
PowerShell is a dynamically implicit typed (also support strongly typed variables) scripting language from Microsoft, mostly focus on task automation and confifuration management. | ||
|
||
PowerShell supports imperative, functional, object-oriented programming, and even pipeline style. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerShell supports imperative, functional, object-oriented programming, and even pipeline style. | |
PowerShell supports imperative, functional, object-oriented, and even pipeline style programming. |
concepts/basics/about.md
Outdated
PowerShell supports imperative, functional, object-oriented programming, and even pipeline style. | ||
|
||
PowerShell was built on the .NET platform and first released in 2006. | ||
It has been included by default in all modern Windows OS, and can be installed on Mac and Linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been included by default in all modern Windows OS, and can be installed on Mac and Linux. | |
It has been included by default in all modern Windows OS, and can also be installed on Mac and Linux. |
concepts/basics/about.md
Outdated
|
||
There are two common ways to define a variable in PowerShell. | ||
|
||
Varible name in PowerShell must start with `$` and using the assignment operator `=` to bind the variable name to a value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Varible name in PowerShell must start with `$` and using the assignment operator `=` to bind the variable name to a value. | |
Variable names in PowerShell must start with a `$`, and use the assignment operator `=` to bind the variable name to a value. |
concepts/basics/about.md
Outdated
System.Double | ||
``` | ||
|
||
You can also explicitly specify a variable's type if you want to enforce a specific type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also explicitly specify a variable's type if you want to enforce a specific type. | |
You can also specify a variable's type explicitly, if you want to enforce/require the value be of a certain type. |
## 1. Define constant expected bake time in minutes | ||
|
||
- You need to define a constant variable, and assign it an integer value. | ||
- Constant can be defined through [New-Variable cmdlet][new variable]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Constant can be defined through [New-Variable cmdlet][new variable]. | |
- Constants can be defined through the [New-Variable cmdlet][new variable]. |
concepts/basics/about.md
Outdated
|
||
### Constants | ||
|
||
Constants in PowerShell are read-only variables that can't be **removed** after defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants in PowerShell are read-only variables that can't be **removed** after defined. | |
Constants in PowerShell are read-only variables that can't be **removed** after definition. |
concepts/basics/about.md
Outdated
### Constants | ||
|
||
Constants in PowerShell are read-only variables that can't be **removed** after defined. | ||
This lead us to the second way to define variables using the cmdlet `New-Variable`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lead us to the second way to define variables using the cmdlet `New-Variable`. | |
This leads us to the second way of defining variables: using the cmdlet `New-Variable`. |
"python/guidos-gorgeous-lasagna" | ||
], | ||
"icon": "lasagna", | ||
"blurb": "Learn the basics of Python by making lasagna." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"blurb": "Learn the basics of Python by making lasagna." | |
"blurb": "Learn the basics of Powershell by making lasagna." |
- Know how to add one or more `parameters` to a function definition. | ||
- Know that `parameters` definitions can have type annotations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see either of these in the exercise instructions, but maybe in the links?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that 2nd part should be moved to the advanced function concept.
Changes made multiple files regarding the wording based on feedback
Add "basics" slug to concepts array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice!