PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.87k stars 379 forks source link

Build is treated as an unapproved verb #2004

Closed Liimurr closed 5 months ago

Liimurr commented 6 months ago

Steps to reproduce

function Build-MyThing {
  Write-Host 'Building thing.'
}

Expected behavior

nothing

Actual behavior

warning: 'The cmdlet Build-MyThing uses unapproved verb'

Notes

Build is listed as an approved verb

liamjpeters commented 5 months ago

Build has only been an approved verb since Sep-2017 and was added in PowerShell 6.0 (Jan-2018).

https://github.com/PowerShell/PowerShell/pull/4725.

I can only reproduce the above in PowerShell 5.1 - which is expected behaviour as it was released Aug-2016.

PowerShell 5.1

image

PowerShell 7.4.2

image

SydneyhSmith commented 5 months ago

Thanks, looks like this is by design-- the verb list is retrieved at run time