- function Move-ADUserOU
- {
- [CmdletBinding(DefaultParameterSetName = 'username',
- SupportsShouldProcess = $true)]
- [OutputType([switch], ParameterSetName = 'username')]
- [OutputType([switch], ParameterSetName = 'csv')]
- [OutputType([switch], ParameterSetName = 'textfile')]
- param
- (
- [Parameter(ParameterSetName = 'textfile',
- Mandatory = $true,
- Position = 2)]
- [string]$ou,
- [Parameter(ParameterSetName = 'username',
- Mandatory = $true,
- ValueFromPipeline = $true,
- Position = 1)]
- $name,
- [Parameter(ParameterSetName = 'textfile',
- Mandatory = $false)]
- $Description,
- [Parameter(ParameterSetName = 'csv',
- ValueFromPipeline = $true)]
- [Parameter(ParameterSetName = 'textfile')]
- [string]$Filepath
- )
Why do some of my parameters do not appear?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Why do some of my parameters do not appear?
Not true. Look at this closely:
Re: Why do some of my parameters do not appear?
Can you please simplify this down to simple demonstration of where your issue is. This forum is not really designed to redesign large amounts of code. Just use the param statement and function wrapper and test without any of the other parts of the code. POst only one function and issue. This will make it easier to understand what you are having problems with.
- weiyen.tan@gmail.com
- Posts: 55
- Last visit: Fri Oct 27, 2023 10:59 pm
Re: Why do some of my parameters do not appear?
- [Parameter(ParameterSetName = 'textfile')]
- [string]$Filepath
- MikeFRobbins
- Posts: 8
- Last visit: Thu Apr 11, 2019 1:55 pm
Re: Why do some of my parameters do not appear?
You do realize that you have two functions with the same name (Move-ADUserOU), correct? The parameters and help show up when I only use the one at the top, but the one at the bottom overrides the first one and does not contain the parameters or help that you're looking for.
Mike F Robbins
Microsoft MVP, SAPIEN MVP
Microsoft MVP, SAPIEN MVP
- weiyen.tan@gmail.com
- Posts: 55
- Last visit: Fri Oct 27, 2023 10:59 pm
Re: Why do some of my parameters do not appear?
Thanks Mike I didnt even see the extra function...
I thought I had gone crazy...now everything is working as it should.
I thought I had gone crazy...now everything is working as it should.
Re: Why do some of my parameters do not appear?
Mike s more patent then I am.
In the future it would help if you tried to reduce your issue to far fewer lines of code. Most forums are all volunteers and we don't want to spend a day on one issue.
If you had posted your script as a file I would have opened it in PowerShell studio directly - yes we can open the files right from the web site - and it would have been much easier to see the issues.
In the future it would help if you tried to reduce your issue to far fewer lines of code. Most forums are all volunteers and we don't want to spend a day on one issue.
If you had posted your script as a file I would have opened it in PowerShell studio directly - yes we can open the files right from the web site - and it would have been much easier to see the issues.
- weiyen.tan@gmail.com
- Posts: 55
- Last visit: Fri Oct 27, 2023 10:59 pm
Re: Why do some of my parameters do not appear?
Ok thanks jvierra,
Will post the entire script that is having the problem next time. Thank you for the help.
Will post the entire script that is having the problem next time. Thank you for the help.
jvierra wrote:Mike s more patent then I am.
In the future it would help if you tried to reduce your issue to far fewer lines of code. Most forums are all volunteers and we don't want to spend a day on one issue.
If you had posted your script as a file I would have opened it in PowerShell studio directly - yes we can open the files right from the web site - and it would have been much easier to see the issues.
Re: Why do some of my parameters do not appear?
Will post the entire script that is having the problem next time. Thank you for the help.
-
Post ,it as a file attachment so we can open it. Pasting it does not make the script openable and it is too hard to read and copy when you have more than a few lines.
Also try to reduce issue to the fewest lines needed to demonstrate the problem. This is the norm for nearly all forums.
Glad you feel that it is fixed.
-
Post ,it as a file attachment so we can open it. Pasting it does not make the script openable and it is too hard to read and copy when you have more than a few lines.
Also try to reduce issue to the fewest lines needed to demonstrate the problem. This is the norm for nearly all forums.
Glad you feel that it is fixed.