Closed adrimus closed 2 months ago
Code doesn't work
Under Named Parameters, In the section where you can add PSDefaultValue to provide a brief help string, for example:
function Get-SmallFiles { param ( [PSDefaultValue(Help = '100')] $Size = 100 ) }
If I then execute the function it doesn't do anything, I think it should be:
function Get-SmallFiles { param ( [PSDefaultValue(Help = '100')] $Size = 100 ) Get-ChildItem $HOME | Where-Object { $_.Length -lt $Size -and !$_.PSIsContainer } }
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.4
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md
@sdwheeler
004bf422-04f5-50e2-3c89-2ff449d2867f
Type of issue
Code doesn't work
Feedback
Under Named Parameters, In the section where you can add PSDefaultValue to provide a brief help string, for example:
If I then execute the function it doesn't do anything, I think it should be:
Page URL
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.4
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md
Author
@sdwheeler
Document Id
004bf422-04f5-50e2-3c89-2ff449d2867f