# Why is $input not available for parameter Name?

**URL:** <https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057>\
**Category:** PowerShell Help\
**Created:** [May 5, 2024, 5:58am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057 "2024-05-05T05:58:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dengshen1575040](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dengshen1575040/32/4888_2.png) [@dengshen1575040](https://forums.powershell.org/u/dengshen1575040)\
**Post date:** [May 5, 2024, 5:58am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/1 "2024-05-05T05:58:44Z")

</div>

I was writting a function using

```auto
[CmdletBinding()]
param (
    [Parameter()]
    [string]
    $input
)
$input 

>test.ps1 1

>

```

As i input the parameter it is still $null  
And after a while i realize the parameter name “$input” cause the problem

---

<div class="post-metadata">

**Author:** ![grey0ut](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/grey0ut/32/5310_2.png) [@grey0ut](https://forums.powershell.org/u/grey0ut)\
**Post date:** [May 5, 2024, 6:20am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/2 "2024-05-05T06:20:42Z")

</div>

$Input is a built-in automatic variable which is why it can’t be used for your parameter name.  
Take a look at all the automatic variables that exist so you familiarize yourself with them:  
[Powershell Automatic Variables](https://ss64.com/ps/syntax-automatic-variables.html)  
[Strongly Encouraged Development Guidelines](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines?view=powershell-7.4#parameter-design-guidelines-sd03)

---

<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:** [May 5, 2024, 8:32am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/3 "2024-05-05T08:32:33Z")

</div>

… adding to Courtney’s helpful answer I’d like to add that you should use a proper [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) for your code development. [VSCode](https://code.visualstudio.com/) is a very common and recommendable choice for PowerShell scripters. It will help you avoiding a lot of silly beginner failures like the one you’re asking about. 😉

---

<div class="post-metadata">

**Author:** ![dengshen1575040](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dengshen1575040/32/4888_2.png) [@dengshen1575040](https://forums.powershell.org/u/dengshen1575040)\
**Post date:** [May 5, 2024, 10:03am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/4 "2024-05-05T10:03:21Z")

</div>

first i like to thank for you advice ,but but my vscode didn’t mark the error when i writting it ,is there any plugin i could use to avoid it ?

---

<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:** [May 5, 2024, 11:34am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/5 "2024-05-05T11:34:04Z")

</div>

You need at least the _PowerShell_ extension. Then it should look like this:

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

… and when you install the extension _Error Lens_ it looks like this:

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

---

<div class="post-metadata">

**Author:** ![dengshen1575040](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dengshen1575040/32/4888_2.png) [@dengshen1575040](https://forums.powershell.org/u/dengshen1575040)\
**Post date:** [May 5, 2024, 11:55am UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/6 "2024-05-05T11:55:42Z")

</div>

thanks for your advice

---

<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 5, 2024, 1:33pm UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/7 "2024-05-05T13:33:33Z")

</div>

If you could, when you’re asking a powershell question, please don’t post it in uncategorized, post it in powershell help. that way when someone answers your question, you can mark their answer as the solution. Appreciate it! I fixed your post (i’ve been fixing all your other posts as you have posted them as well 🙂

---

<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 5, 2024, 1:33pm UTC](https://forums.powershell.org/t/why-is-input-not-available-for-parameter-name/24057/8 "2024-05-05T13:33:59Z")

</div>


