René's URL Explorer Experiment


Title: Suggestion: implement Bash-style && and || control operators for chaining commands based on success / failure - short-circuiting Boolean execution-flow control operators · Issue #3241 · PowerShell/PowerShell · GitHub

Open Graph Title: Suggestion: implement Bash-style && and || control operators for chaining commands based on success / failure - short-circuiting Boolean execution-flow control operators · Issue #3241 · PowerShell/PowerShell

X Title: Suggestion: implement Bash-style && and || control operators for chaining commands based on success / failure - short-circuiting Boolean execution-flow control operators · Issue #3241 · PowerShell/PowerShell

Description: Bash-style && and || control operators would be handy additions to the language. For instance, instead of writing (the examples are contrived, but hopefully illustrate the point): # If command A succeeds, execute command B too. csc /nolo...

Open Graph Description: Bash-style && and || control operators would be handy additions to the language. For instance, instead of writing (the examples are contrived, but hopefully illustrate the point): # If command A su...

X Description: Bash-style && and || control operators would be handy additions to the language. For instance, instead of writing (the examples are contrived, but hopefully illustrate the point): # If comm...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3241

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: implement Bash-style && and || control operators for chaining commands based on success / failure - short-circuiting Boolean execution-flow control operators","articleBody":"Bash-style `&&` and `||` control operators would be handy additions to the language.\r\n\r\nFor instance, instead of writing (the examples are contrived, but hopefully illustrate the point):\r\n\r\n```powershell\r\n# If command A succeeds, execute command B too.\r\ncsc /nologo file.cs\r\nif (0 -eq $LASTEXITCODE) { git commit -m 'ok' }\r\n\r\n# if command A fails, execute command B.\r\ncsc /nologo file.cs\r\nif (0 -ne $LASTEXITCODE) { git commit -m 'failed'  }\r\n```\r\n\r\none might be able to write:\r\n\r\n```powershell\r\n# If command A succeeds, execute command B too.\r\ncsc /nologo file.cs && git commit -m 'ok'\r\n\r\n# if command A fails, execute command B.\r\ncsc /nologo file.cs || git commit -m 'failed'\r\n```\r\n\r\nThe examples use external utilities, but these operators would be equally handy for PowerShell-native commands (where `$?` rather than `$LASTEXITCODE` would have to be examined).\r\n\r\n---\r\n\r\n* There was [talk about adding `&&` and `||` in 2009](http://stackoverflow.com/a/573295/45375), but it seemingly never made the top of the list. Notably, @jpsnover  himself said:\r\n\r\n> && and || were on the list of things to implement (still are) but did not pop up as the next most useful thing to add.\r\n \r\n* There is a [feature request on windowsserver.uservoice.com](https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11087898-implement-the-and-operators-that-bash-has) that seems to be languishing.\r\n\r\nThere are several other questions on Stack Overflow asking for this feature and I've tried to summarize the state of affairs in [this answer](http://stackoverflow.com/a/41816341/45375).\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-03-02T21:01:00Z","url":"https://github.com/PowerShell/PowerShell/issues/3241"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:71ec33b3-e2c9-4d04-d5f4-6c30868a73df
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB6A:1BB1CE:5FA98:819E0:6AFD48A8
html-safe-nonce00e7b4a91f7ebde32e701b7952dc54e97b56c2243e941243a7b7bfe100b486fd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjZBOjFCQjFDRTo1RkE5ODo4MTlFMDo2QUZENDhBOCIsInZpc2l0b3JfaWQiOiIzMTkwMjUxOTMwNTkyODIzNDY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4ee4ca47b4084601fdf65a7fb033dda2dfc28b78688d23ce6565627cfe7412ed
hovercard-subject-tagissue:211516238
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/PowerShell/PowerShell/3241/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3d48c9fb98b69cb6e42b1b96ce4272d202d5be3912c76d07a2ecd9bf4dff87cb/PowerShell/PowerShell/issues/3241
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3d48c9fb98b69cb6e42b1b96ce4272d202d5be3912c76d07a2ecd9bf4dff87cb/PowerShell/PowerShell/issues/3241
og:image:altBash-style && and || control operators would be handy additions to the language. For instance, instead of writing (the examples are contrived, but hopefully illustrate the point): # If command A su...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemklement0
hostnamegithub.com
expected-hostnamegithub.com
Nonebdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
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
release556dd37bb0aceffb25724e151b5d858b3265b40b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/3241#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F3241
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F3241
Sign uphttps://github.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=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/3241
Reloadhttps://github.com/PowerShell/PowerShell/issues/3241
Reloadhttps://github.com/PowerShell/PowerShell/issues/3241
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/3241
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/3241
#9849https://github.com/PowerShell/PowerShell/pull/9849
Suggestion: implement Bash-style && and || control operators for chaining commands based on success / failure - short-circuiting Boolean execution-flow control operatorshttps://github.com/PowerShell/PowerShell/issues/3241#top
#9849https://github.com/PowerShell/PowerShell/pull/9849
https://github.com/rjmholt
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
7.0-Considerhttps://github.com/PowerShell/PowerShell/milestone/54
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Mar 2, 2017https://github.com/PowerShell/PowerShell/issues/3241#issue-211516238
talk about adding && and || in 2009http://stackoverflow.com/a/573295/45375
Jeffrey Snover (@jpsnover)https://github.com/jpsnover
feature request on windowsserver.uservoice.comhttps://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11087898-implement-the-and-operators-that-bash-has
this answerhttp://stackoverflow.com/a/41816341/45375
Nexthttps://github.com/PowerShell/PowerShell/issues/3241?timeline_page=1
Bruce Payette (BrucePay)https://github.com/BrucePay
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
on Mar 2, 2017https://github.com/PowerShell/PowerShell/issues/3241#event-984411081
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Mar 4, 2017https://github.com/PowerShell/PowerShell/issues/3241#event-986370222
Michael Klement (mklement0)https://github.com/mklement0
on Aug 14, 2017https://github.com/PowerShell/PowerShell/issues/3241#event-1205084967
https://github.com/i-give-up
i-give-uphttps://github.com/i-give-up
on Oct 3, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-333770935
Michael Klement (mklement0)https://github.com/mklement0
on Oct 3, 2017https://github.com/PowerShell/PowerShell/issues/3241#event-1275919487
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Oct 3, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-333835781
i-give-uphttps://github.com/i-give-up
POSIX call them control operatorshttp://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_06
https://github.com/lenkite
Tarun Elankath (lenkite)https://github.com/lenkite
on Oct 18, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-337452731
https://github.com/stofte
Svend Tofte (stofte)https://github.com/stofte
on Nov 9, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-343192776
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Nov 9, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-343244816
Svend Tofte (@stofte)https://github.com/stofte
https://github.com/stofte
Svend Tofte (stofte)https://github.com/stofte
on Nov 10, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-343437459
Michael Klement (@mklement0)https://github.com/mklement0
https://github.com/dragonwolf83
Troy Campbell (dragonwolf83)https://github.com/dragonwolf83
on Nov 10, 2017https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-343567375
Svend Tofte (@stofte)https://github.com/stofte
https://github.com/jurriaanr
jurriaanrhttps://github.com/jurriaanr
on Apr 13, 2018https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-381126472
https://github.com/rjmholt
Rob Holt (rjmholt)https://github.com/rjmholt
on Apr 21, 2018https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-383263156
short circuit operator implementationhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators#Description
null-coalescing functionalityhttps://github.com/PowerShell/PowerShell/issues/3240
ternary operatorhttps://github.com/PowerShell/PowerShell/issues/3239
RFChttps://github.com/PowerShell/PowerShell-RFC
https://github.com/saschanaz
Kagami Sascha Rosylight (saschanaz)https://github.com/saschanaz
on Apr 21, 2018https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-383267093
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
6.2.0-Considerhttps://github.com/PowerShell/PowerShell/milestone/42
Futurehttps://github.com/PowerShell/PowerShell/milestone/48
on Jun 21, 2018https://github.com/PowerShell/PowerShell/issues/3241#event-1694668442
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Futurehttps://github.com/PowerShell/PowerShell/milestone/48
6.3-Considerhttps://github.com/PowerShell/PowerShell/milestone/54
on Feb 19, 2019https://github.com/PowerShell/PowerShell/issues/3241#event-2150227304
https://github.com/mikemaccana
Mike MacCana (mikemaccana)https://github.com/mikemaccana
on Apr 6, 2019https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-480541208
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Apr 7, 2019https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-480551663
Mike MacCana (@mikemaccana)https://github.com/mikemaccana
https://github.com/vladimiry
Vladimir Yakovlev (vladimiry)https://github.com/vladimiry
on Apr 27, 2019https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-487291795
https://community.dynamics.com/nav/b/stefanodemiliani/archive/2018/02/28/running-microsoft-dynamics-nav-tasks-in-parallel-with-powershellhttps://community.dynamics.com/nav/b/stefanodemiliani/archive/2018/02/28/running-microsoft-dynamics-nav-tasks-in-parallel-with-powershell
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Apr 27, 2019https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-487292611
Vladimir Yakovlev (@vladimiry)https://github.com/vladimiry
Rob Holt (rjmholt)https://github.com/rjmholt
on Jun 3, 2019https://github.com/PowerShell/PowerShell/issues/3241#event-2385702195
https://github.com/rjmholt
Rob Holt (rjmholt)https://github.com/rjmholt
on Jun 12, 2019https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-501449377
PowerShell/PowerShell-RFC#192https://github.com/PowerShell/PowerShell-RFC/pull/192
Dongbo Wang (daxian-dbw)https://github.com/daxian-dbw
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#9849https://github.com/PowerShell/PowerShell/pull/9849
on Oct 17, 2019https://github.com/PowerShell/PowerShell/issues/3241#event-2722857537
Ilya (iSazonov)https://github.com/iSazonov
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
on Nov 11, 2019https://github.com/PowerShell/PowerShell/issues/3241#event-2787620490
Dan Macumber (macumber)https://github.com/macumber
on Oct 19, 2021https://github.com/PowerShell/PowerShell/issues/3241#event-5482322901
Try to work around powershell being the stupidest shell everhttps://github.com/openstudiocoalition/OpenStudioApplication/commit/bcf0ee6785d6203d294e49f8b10a8a7d3a53af08
bcf0ee6https://github.com/openstudiocoalition/OpenStudioApplication/commit/bcf0ee6785d6203d294e49f8b10a8a7d3a53af08
https://github.com/Raffaello
Raffaello (Raffaello)https://github.com/Raffaello
on Jan 15, 2022https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-1013663027
https://github.com/kilasuit
Ryan Yates (kilasuit)https://github.com/kilasuit
on Jan 15, 2022https://github.com/PowerShell/PowerShell/issues/3241#issuecomment-1013663649
Raffaello (@Raffaello)https://github.com/Raffaello
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/3241
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/3241
Rob Holt (rjmholt)https://github.com/rjmholt
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Languageparser, language semanticshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Language%22
7.0-Considerhttps://github.com/PowerShell/PowerShell/milestone/54
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.