PowerShell / PSScriptAnalyzer

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

Build is treated as an unapproved verb #2004

Closed Liimurr closed 3 weeks ago

Liimurr commented 1 month 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 1 month 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 4 weeks ago

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