# Run a Script with Parameters in command line Powershell

**URL:** <https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624>\
**Category:** PowerShell Help\
**Created:** [October 11, 2022, 12:45pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624 "2022-10-11T12:45:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beginner590](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/beginner590/32/3990_2.png) [@Beginner590](https://forums.powershell.org/u/Beginner590)\
**Post date:** [October 11, 2022, 12:45pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624/1 "2022-10-11T12:45:34Z")

</div>

Hi guys,  
I need your help 😖

How do you create a script that will read the content in a csv file given as a parameter when you run the script execution command from the command line?

---

<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:** [October 11, 2022, 1:36pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624/2 "2022-10-11T13:36:39Z")

</div>

I’m unsure what your actual question is … how about using a parameter? 🤔

Do you actually use an internet search engine sometimes?

> **[about Parameters - PowerShell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parameters?view=powershell-7.2)**
>
> Describes how to work with command parameters in PowerShell.

> **[about Functions Advanced Parameters - PowerShell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.2)**
>
> Explains how to add parameters to advanced functions.

---

<div class="post-metadata">

**Author:** ![Beginner590](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/beginner590/32/3990_2.png) [@Beginner590](https://forums.powershell.org/u/Beginner590)\
**Post date:** [October 11, 2022, 4:32pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624/3 "2022-10-11T16:32:58Z")

</div>

What do I mean is more like when I put my script file in the command line in PowerShell for make it run, I have to put in parameter a csv file. The things is I don’t know how to make my script run with a file in parameters. I dont know if you understand what i mean but it’s like this 😟

![image](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/c/c0f977fb83e9eabfc698298ba425f73853556333.png)

So i dont know how to make it happen in my script.

---

<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:** [October 11, 2022, 6:25pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624/4 "2022-10-11T18:25:45Z")

</div>

> [@Beginner590](#):
>
> I dont know if you understand what i mean

I know exactly what you mean and I already linked helpful help topics for you in my last answer. Did you read them? Is there something particular you don’t understand?

As a general tip: In the vast majority of the cases you’re not the first one with a given task or problem. So it is pretty likely that you’ll find something you can use right away or at least use as an inspiration to adapt it to your particular needs.

Something like this:

[https://www.google.com/search?q=Powershell+script+parameters](https://www.google.com/search?q=Powershell+script+parameters)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:16pm UTC](https://forums.powershell.org/t/run-a-script-with-parameters-in-command-line-powershell/20624/5 "2024-05-16T20:16:33Z")

</div>


