René's URL Explorer Experiment


Title: Consider revising PERF-02 · Issue #148 · PoshCode/PowerShellPracticeAndStyle · GitHub

Open Graph Title: Consider revising PERF-02 · Issue #148 · PoshCode/PowerShellPracticeAndStyle

X Title: Consider revising PERF-02 · Issue #148 · PoshCode/PowerShellPracticeAndStyle

Description: I have some suggestions for improving "PERF-02 Consider trade-offs between performance and readability". I hope it's OK to group multiple "issues" here rather than spamming the Issues section. The first issue, the page directs a user to ...

Open Graph Description: I have some suggestions for improving "PERF-02 Consider trade-offs between performance and readability". I hope it's OK to group multiple "issues" here rather than spamming the Issues section. The ...

X Description: I have some suggestions for improving "PERF-02 Consider trade-offs between performance and readability". I hope it's OK to group multiple "issues" here rather than spamming ...

Opengraph URL: https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/148

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consider revising PERF-02","articleBody":"I have some suggestions for improving \"PERF-02 Consider trade-offs between performance and readability\". I hope it's OK to group multiple \"issues\" here rather than spamming the Issues section. \r\n\r\nThe first issue, the page directs a user to drop into using a .NET framework to do something (basically read a file) when a PowerShell cmdlet already exists to do the same thing. The page actually called out the appropriate cmdlet a moment before. This is in contradiction to other advice that, generally, you should avoid using .NET or external tool when PowerShell can effectively do the same thing. \r\n\r\nSecond, the page uses the .NET code to do something that PowerShell handles natively with the Pipeline. I use Powershell a lot in my professional career, and I can say that 80% of time I'm handling collections of objects. Which computers in this list have x.yy version of Audio Driver? Which AD users are locked and/or password expired? The pipeline is king, the king is dead, all hail the king. \r\n\r\nGet-Content -Path file.txt | ForEach-Object -Process { \u003c#...#\u003e } \r\nOf the options in the article, this is absolutely the best way to approach the input. \r\n\r\nHeck, even \"one object\" collections circumstantially benefit from going through the pipeline. Consider the scenario, I want widget.exe to not run. For the purpose of this example I expect at most one instance of wdiget.exe to run. And maybe it's not running presently, I don't care. But I certainly want to stop, if it is running. \r\nStop-Process -Name widget\r\nThis will generate an error if widget.exe is not running. I don't want an error message in this case. If I'm stopping on errors, this will break the script. \r\n\r\nGet-Process -Name widget | Stop-Process\r\nEven if there is never 2 or more instances of widget.exe, this is the best way to handle the use case (and IMO, it looks great). If the process is not running, then nothing gets passed to Stop-Process. Rather than generating an error, Stop-Process just sits there and twiddles its thumbs. \r\n\r\nLess important but worth mentioning, the page uses what Wikipedia would call \"Weasel words.\" See:\r\nhttps://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions\r\nExamples, \"many folks in the community\", \"Most folks\", \"Some would argue\". Who are these people, and why should I care? I was sysadmin at a factory and I love the assembly line approach to my control scripts. I often script in this format:\r\n```\r\nparam (\r\n    # Bunch of variables I might want to customize in the future\r\n)\r\n\r\n# in production, functions actually reside in a module psm1 file I wrote, which I import here\r\nfunction Verb-Stuff {\r\n    param ( \r\n        [parameter(Mandatory,ValueFromPipeline)][type]$Object\r\n        # Other parameters ...\r\n    )\r\n    Process {\r\n        try {\r\n            # Do stuff ...\r\n        } \r\n        catch {\r\n            # error handling\r\n        }\r\n    }\r\n}\r\n\r\nGet-Stuff -Property $Parameter | Where-Object { \u003c#filter stuff#\u003e } | Verb-Stuff | Out-Stuff \r\n\r\n```\r\nI find the above to be very aesthetically pleasing, and easy to follow. I understand that not everyone will agree, but honestly I don't care. Aesthetics are nice when talking about tab lengths, max line lengths, NamingConventions, etc. When you are writing code in production, \"aesthetics\" are not a good reason to change the function of the code. To do so risks unplanned problems.\r\n","author":{"url":"https://github.com/jdtrouble","@type":"Person","name":"jdtrouble"},"datePublished":"2020-12-03T15:12:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/148/PowerShellPracticeAndStyle/issues/148"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:44bb840e-a1bf-2463-1ea2-069d2a06d3ee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEB74:3E913B:723DD3:9D06CF:6977558B
html-safe-nonced6506fdbbe9df6d5cd686c7fc16f344772d0f7df571efc94e30050faab5b2b71
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjc0OjNFOTEzQjo3MjNERDM6OUQwNkNGOjY5Nzc1NThCIiwidmlzaXRvcl9pZCI6IjE3MjIwMjEzNzYyMjQwODk0ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace20b61aaa5e81616e59140b39c1ca3c042b14d6babddfa5dfba29ed0a42c3aac
hovercard-subject-tagissue:756282489
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PoshCode/PowerShellPracticeAndStyle/148/issue_layout
twitter:imagehttps://opengraph.githubassets.com/21ccbd1d3fd3b9f33f179ab6cbdeb7ffdd2a9a3e7504cbf582cf3d368c5469da/PoshCode/PowerShellPracticeAndStyle/issues/148
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/21ccbd1d3fd3b9f33f179ab6cbdeb7ffdd2a9a3e7504cbf582cf3d368c5469da/PoshCode/PowerShellPracticeAndStyle/issues/148
og:image:altI have some suggestions for improving "PERF-02 Consider trade-offs between performance and readability". I hope it's OK to group multiple "issues" here rather than spamming the Issues section. The ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejdtrouble
hostnamegithub.com
expected-hostnamegithub.com
None3310064f35a62c06a4024ba37f41c06836f39376a095c2dfd2c4b693c34965be
turbo-cache-controlno-preview
go-importgithub.com/PoshCode/PowerShellPracticeAndStyle git https://github.com/PoshCode/PowerShellPracticeAndStyle.git
octolytics-dimension-user_id5641451
octolytics-dimension-user_loginPoshCode
octolytics-dimension-repository_id17317123
octolytics-dimension-repository_nwoPoshCode/PowerShellPracticeAndStyle
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17317123
octolytics-dimension-repository_network_root_nwoPoshCode/PowerShellPracticeAndStyle
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release67d5f8d1d53c3cc4f49fc3bb8029933c3dc219e6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues/148#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FPoshCode%2FPowerShellPracticeAndStyle%2Fissues%2F148
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FPoshCode%2FPowerShellPracticeAndStyle%2Fissues%2F148
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PoshCode%2FPowerShellPracticeAndStyle
Reloadhttps://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues/148
Reloadhttps://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues/148
Reloadhttps://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues/148
PoshCode https://patch-diff.githubusercontent.com/PoshCode
PowerShellPracticeAndStylehttps://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FPoshCode%2FPowerShellPracticeAndStyle
Fork 294 https://patch-diff.githubusercontent.com/login?return_to=%2FPoshCode%2FPowerShellPracticeAndStyle
Star 2.4k https://patch-diff.githubusercontent.com/login?return_to=%2FPoshCode%2FPowerShellPracticeAndStyle
Code https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle
Issues 37 https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues
Pull requests 1 https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/pulls
Discussions https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/discussions
Actions https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/actions
Projects 0 https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/projects
Wiki https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/wiki
Security 0 https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/security
Insights https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/pulse
Code https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle
Issues https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues
Pull requests https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/pulls
Discussions https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/discussions
Actions https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/actions
Projects https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/projects
Wiki https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/wiki
Security https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/security
Insights https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/148
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/148
Consider revising PERF-02https://patch-diff.githubusercontent.com/PoshCode/PowerShellPracticeAndStyle/issues/148#top
https://github.com/jdtrouble
https://github.com/jdtrouble
jdtroublehttps://github.com/jdtrouble
on Dec 3, 2020https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/148#issue-756282489
https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributionshttps://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.