r/PowerShell • • Dec 06 '19

Windows PowerShell Introduction

https://www.youtube.com/watch?v=TUNNmVeyjW0
143 Upvotes

14 comments sorted by

12

u/Alaknar Dec 06 '19

I love how these days you actually need to note that a PowerShell tutorial is for Windows.

7

u/timb0-slice Dec 06 '19

I believe the cross platform version (PowerShell Core 6 and soon to be just PowerShell 7) are just called PowerShell. The Windows only version (5.1) is called Windows PowerShell. Not at all confusing...

This is similar to Windows Server Hyper-V verses just Hyper-V Server not being the same thing.

6

u/OlivTheFrog Dec 07 '19

Ho How much I hate this !

  1. First command ==> No first cmdlet, it's Powershell, not DOS

  2. Use CD. CD is not a cmdlet, it's an alias of a cmdlet. Begin to explain the concept of Alias before to use it rough.

  3. Begin to explain Terminology (Verb-Noun) and parameters. Then explain, that Powershell play with Object (and collections of objects) and not text. Objects haves properties and methods. Illustrate this with some simple examples (i.e. : Get-Date have properties Day, month, ... and methods, AddDays(), AddMonths()) : So simple to explain

  4. After that explain the concept of pipeline before use it without how does it works. I.e. : you can't pass a property to another cmdlet if the property is not in the result of the first cmdlet.

Build a demo for the completly new powershell users, is always a good idea. But build a didactic and useful demo is better.

One positive point for the format (20 in max). After this time, you loose the attention of people.

This video could have been better.

regards

Olivier

P.S. : critical is easy, do the thing is harder, I know it. :-)

5

u/SeeminglyScience Dec 07 '19

First command ==> No first cmdlet, it's Powershell, not DOS

A cmdlet is a specific type of command, one that is a subclass of the .NET class Cmdlet. There are several types of commands that are not cmdlets. Functions (script based commands typically defined with the function language keyword), aliases, external scripts, scripts, workflows (Windows PowerShell only) and native. A cmdlet is a command, but a command is not necessarily a cmdlet.

Use CD. CD is not a cmdlet, it's an alias of a cmdlet. Begin to explain the concept of Alias before to use it rough.

An alias is considered a command at various points in the engine. It is ultimately translated to it's destination command before reaching a command processor so you might be able to consider that subjective, but generally speaking it's considered a command.

-1

u/MRJKY Dec 06 '19

Ahhh I found this a few weeks back on YouTube. At the time it was the only video uploaded.... Make more, make many more!

4

u/[deleted] Dec 06 '19

[removed] — view removed comment

26

u/matthoback Dec 06 '19

Sysadmins restrict it because it's a huge vector for malware.

0

u/jantari Dec 07 '19

Not really, it's more complex to get someone to run a PowerShell script than just create your own exe in a traditional programming language or office macros

2

u/matthoback Dec 07 '19

Not in the slightest. Stuffing a long line of powershell directly into the registry to be run at login is one of the primary vectors for malware these days.

-1

u/DragonspeedTheB Dec 06 '19

Sadly it's becoming a favourite.

"With great power comes great responsibility"

7

u/Panchorc Dec 06 '19

It's helpful even when you do.

5

u/bennyboo9 Dec 06 '19

Yup. I love Python. However when it comes to Windows specific admin tasks, like working w/ directories I go w/ Powershell as I don’t have to resort to importing all sorts of modules and bending over backwards to do anything.

For Data analysis though, Python & Pandas is the way to go!

3

u/[deleted] Dec 07 '19

Generally I find this to be a knee-jerk reaction for sysadmins and info sec folks that aren't educated enough in the language.

Lee Holmes has some great talks on using PowerShell defensively. His talk at the PowerShell + DevOps Summit 2018 went into depth on this.

https://www.youtube.com/watch?v=M5bkHUQy-JA&list=PLfeA8kIs7CocGXuezOoYtLRdnK9S_Mq3e&index=20&t=0s

2

u/[deleted] Dec 07 '19

Most companies are starting to at least force constrained language mode. But yeah everyone is right, users make it dangerous.