What is the recommended coding style for PowerShell?

前端 未结 3 457
萌比男神i
萌比男神i 2020-12-22 14:51

Is there any recommended coding style how to write PowerShell scripts?

It\'s not about how to structure the code (how many functions, if to use modu

3条回答
  •  一个人的身影
    2020-12-22 15:34

    I believe the most comprehensive coding style resource for PowerShell still is The PowerShell Best Practices and Style Guide.

    From their introduction:

    Like English spelling and grammar rules, PowerShell programming best practices and style rules nearly always have exceptions, but we are documenting a baseline for code structure, command design, programming, formatting, and even style which will help you to avoid common problems, and help you write more reusable, readable code -- because reusable code doesn't have to be rewritten, and readable code can be maintained.

    They also made these GitBook links available:

    • Online content.
    • PDF/ePub download.

提交回复
热议问题