Course Hero Logo

Week 10 post 1 Code complexity.docx - Week 10 post 1 Code...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

Week 10 post 1 Code complexityScripts become complex for several different reasons, the main one being lacking planning or control of ascript if a project.Writing good scripts, it is important to follow 3 good practice rules, avoid aliases,avoid hard-code credentials and avoid using write-host, avoiding these reduces gotchas. Also, you mustfollow the basic principles of naming, structure, objects, patterns. Standard good practice for writingscripts in any language include not repeating code, keep name scheme consistent, break down tasks intosmaller sizes and avoid long code lines. Comments should also be used but ensure they have a purposeand can aid anyone who is reading the script. Comments can be also added between pipelines which canreally help with clarifying the piping.Get-Process |# Sort so the highest-cpu are at the topSort-Object -Descending -Property CPU|# List only the first (top) 10Select-Object -First 10jim (n.d.).

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Abstraction, scripting language

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture