Title: Beta.9 - Module PSReadLine impacting ifelse block structure · Issue #575 · PowerShell/PSReadLine · GitHub
Open Graph Title: Beta.9 - Module PSReadLine impacting ifelse block structure · Issue #575 · PowerShell/PSReadLine
X Title: Beta.9 - Module PSReadLine impacting ifelse block structure · Issue #575 · PowerShell/PSReadLine
Description: Current PowerShell behavior is to automatically load the PSReadLine module. But, this module is breaking the if-else block of code when using Copy/Paste into the PowerShell Console. Steps to reproduce Open PowerShell "pwsh" Console. Copy...
Open Graph Description: Current PowerShell behavior is to automatically load the PSReadLine module. But, this module is breaking the if-else block of code when using Copy/Paste into the PowerShell Console. Steps to reprod...
X Description: Current PowerShell behavior is to automatically load the PSReadLine module. But, this module is breaking the if-else block of code when using Copy/Paste into the PowerShell Console. Steps to reprod...
Opengraph URL: https://github.com/PowerShell/PSReadLine/issues/575
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Beta.9 - Module PSReadLine impacting ifelse block structure","articleBody":"\u003c!--\r\nBefore submitting your bug report, please check for duplicates, and +1 the duplicate if you find one, adding additional details if you have any to add.\r\n\r\nThere are a few common issues that are commonly reported.\r\n\r\nIf there is an exception copying to/from the clipboard, it's probably the same as https://github.com/lzybkr/PSReadLine/issues/265\r\n\r\nIf there is an exception shortly after resizing the console, it's probably the same as https://github.com/lzybkr/PSReadLine/issues/292\r\n--\u003e\r\n\r\nCurrent PowerShell behavior is to automatically load the PSReadLine module. But, this module is breaking the if-else block of code when using Copy/Paste into the PowerShell Console.\r\n\r\nSteps to reproduce\r\n------------------\r\n1. Open PowerShell \"**pwsh**\" Console.\r\n2. Copy/Paste the following code into the Console:\r\n```powershell\r\n## - Code Snippet will verify if NuGet is already installed:\r\nif (-not (Get-PackageSource | Where-Object{$_.Name -eq 'Nuget'})) \r\n{\r\n Register-PackageSource -Name Nuget -ProviderName NuGet -Location https://www.nuget.org/api/v2\r\n}\r\nelse\r\n{\r\n Write-Host \"NuGet Already Exist! No Need to install.\"\r\n}\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nProcess the code without errors.\r\n\r\nBelow, the results of executing the \"if-else\" block without errors, after executing \"**Remove-Module PSReadLine**\"\r\n```Results\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e if (-not (Get-PackageSource | Where-Object{$_.Name -eq 'Nuget'}))\r\n\u003e\u003e {\r\n\u003e\u003e Register-PackageSource -Name Nuget -ProviderName NuGet -Location https://www.nuget.org/api/v2\r\n\u003e\u003e }\r\n\u003e\u003e else\r\n\u003e\u003e {\r\n\u003e\u003e Write-Host \"NuGet Already Exist! No Need to install.\"\r\n\u003e\u003e }\r\n\u003e\u003e\r\nNuGet Already Exist! No Need to install.\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e\r\n\r\n```\r\n\r\nActual behavior\r\n---------------\r\nPaste code stopped executing after it reads the \"else\".\r\n```none\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e if (-not (Get-PackageSource | Where-Object{$_.Name -eq 'Nuget'}))\r\n\u003e\u003e {\r\n\u003e\u003e Register-PackageSource -Name Nuget -ProviderName NuGet -Location https://www.nuget.org/api/v2\r\n\u003e\u003e }\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e else\r\nelse : The term 'else' is not recognized as the name of a cmdlet, function, script file, or operable program.\r\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\r\nAt line:1 char:1\r\n+ else\r\n+ ~~~~\r\n + CategoryInfo : ObjectNotFound: (else:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e {\r\n\u003e\u003e Write-Host \"NuGet Already Exist! No Need to install.\"\r\n\u003e\u003e }\r\n\r\n Write-Host \"NuGet Already Exist! No Need to install.\"\r\n\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e\r\n\r\n```\r\n\r\nEnvironment data\r\n----------------\r\nOS: \r\nWindows 10 Insider Build 1702\r\nUbuntu 16.04.3\r\n\r\nPowerShell Core Beta.9\r\n\r\n\u003c!-- provide the output of $PSVersionTable --\u003e\r\n\r\n``` Windows Powershell\r\n## - Windows PowerShell Core\r\nPS C:\\Program Files\\PowerShell\\6.0.0-beta.9\u003e $PSVersionTable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta.9\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.9\r\nOS Microsoft Windows 10.0.17025\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n```\r\n``` Linux PowerShell\r\n## - Linux PowerShell Core\r\nPS /home/maxt\u003e $PSVersionTable \r\n\r\nName Value \r\n---- ----- \r\nPSVersion 6.0.0-beta.9 \r\nPSEdition Core \r\nGitCommitId v6.0.0-beta.9 \r\nOS Linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 \r\nPlatform Unix \r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} \r\nPSRemotingProtocolVersion 2.3 \r\nSerializationVersion 1.1.0.1 \r\nWSManStackVersion 3.0\r\n\r\n```\r\n\r\n","author":{"url":"https://github.com/MaximoTrinidad","@type":"Person","name":"MaximoTrinidad"},"datePublished":"2017-11-07T00:41:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/575/PSReadLine/issues/575"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e6307fb6-f38e-2348-3e41-fa7213c95b1b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D03C:F3CF:2A6978:3D0E34:6A59D845 |
| html-safe-nonce | b9e6394c0d9dbf6509d2b07acb834f952cc2d3a3750ca9338dc93173d407affa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDNDOkYzQ0Y6MkE2OTc4OjNEMEUzNDo2QTU5RDg0NSIsInZpc2l0b3JfaWQiOiI4OTI4MjE1OTU0NzA4MDkyOTk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9c23af931e336c2a9d7a6b586584248208d2087c43c9c0f597544bba555cbd45 |
| hovercard-subject-tag | issue:271671237 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PSReadLine/575/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2eb65da6cef63269d8a1feec6297edbf97c593e753b4b713fece76cfc412f227/PowerShell/PSReadLine/issues/575 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2eb65da6cef63269d8a1feec6297edbf97c593e753b4b713fece76cfc412f227/PowerShell/PSReadLine/issues/575 |
| og:image:alt | Current PowerShell behavior is to automatically load the PSReadLine module. But, this module is breaking the if-else block of code when using Copy/Paste into the PowerShell Console. Steps to reprod... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaximoTrinidad |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PSReadLine git https://github.com/PowerShell/PSReadLine.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 10025737 |
| octolytics-dimension-repository_nwo | PowerShell/PSReadLine |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 10025737 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSReadLine |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bfacf98c3b7ad151665d6ddd216469389872b251 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width