New to Powershell need help

I have begun some training for PowerShell at my remote work-study. From the training, I understand the commands and how to use/find them and some basic stuff but I struggle with setting parameters/arguments to run actual scripts. How do I do that and how do I know what to use/when? Thanks.

Hi, welcome to the forum :wave:

Can you give an example of what you’re struggling with?
You should be familiar with Get-Help which, at least for the basics, should be all you need to discover a cmdlet’s parameters, whether or not they’re mandatory, and what type of objects you can pass to them.

If you’re talking about how to accept parameters and input to your own scripts then show us what you’re struggling with and we’ll help you work through it.

What format is your training: classroom, video, book?

A lot of my training is videos. One of things they want me to do is using the get-windowsfeature command. But i am unsure how to use arguments/parameters with commands to ge them to execute properly.

For what? :wink:

Did you read the help? You could follow the examples.

1 Like

for practice with scripts and I can copy that stuff but I don’t understand what a lot of it is saying or how to know what to use if using something like another command.

The message I received was that I should practice writing a powershell script to perform or test a windows 10 feature. The only experience I have so far with powershell is videos or basic stuff in class that gives me step by step instruction

First of all - Get-WindowsFeature targets Windows Server - not Windows 10.
Then - it might be my lack of my knowledge about the english language but I don’t know how to perfrom a Windows feature. The cmdlet gets the information if it’s installed or not. There’s just this. And that’s shown in the examples.

We all have been there once. :wink: Keep playing around with it. Try this and that and don’t push yourself too hard. A lot of understanding comes with time and experience.

We ended up using windows-optionalfeature. I’m just nervous as this is my workstudy and I am from remote and feel like im wasting time looking over some things while waiting for the call so I can watch him do some stuff and talk me through the motions.

Any command that starts with Get- should not make any changes so should not be risky to run. What Olaf is suggesting is start poking around. Run Get-WindowsOptionalFeature. Try storing the output to a variable. Try inspecting the variable with commands like Get-Member. Run get-help anyword to search for help that relates to that word.

1 Like

What do you mean by try “storing the output to a variable” ? I guess I don’t understand.

It is beyond the scope of this or any forum to teach the very fundamentals of a complex technology like scripting with PowerShell. You will have to learn this first by yourself.

There are more than enough free courses on Youtube and even free online books available for you to start with. Please take your time to watch some of these youtube videos or read some chapters of some beginner books.

If you get stuck with a particular piece of code you can share this code here along with an explanation of what is not working as expected and we will be more than happy to help you further but we cannot learn for you. :wink:

… for example … it’s a little older but the basics of PowerShell are still the same …

1 Like