Title: Transient RULE_ERROR · Issue #1351 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: Transient RULE_ERROR · Issue #1351 · PowerShell/PSScriptAnalyzer
X Title: Transient RULE_ERROR · Issue #1351 · PowerShell/PSScriptAnalyzer
Description: I wish I could provide more information, but the error is transient and therefore cannot be deterministically reproed. PowerShell version: 6.2.1 PSScriptAnalyzer version: 1.18.3 OS Version: Ubuntu 1604 PSScriptAnalyzer is failing occasio...
Open Graph Description: I wish I could provide more information, but the error is transient and therefore cannot be deterministically reproed. PowerShell version: 6.2.1 PSScriptAnalyzer version: 1.18.3 OS Version: Ubuntu ...
X Description: I wish I could provide more information, but the error is transient and therefore cannot be deterministically reproed. PowerShell version: 6.2.1 PSScriptAnalyzer version: 1.18.3 OS Version: Ubuntu ...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/1351
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transient RULE_ERROR","articleBody":"I wish I could provide more information, but the error is transient and therefore cannot be deterministically reproed.\r\n\r\nPowerShell version: 6.2.1\r\nPSScriptAnalyzer version: 1.18.3\r\nOS Version: Ubuntu 1604\r\n\r\nPSScriptAnalyzer is failing occasionally with the following error:\r\n```\r\nInvoke-ScriptAnalyzer : Object reference not set to an instance of an object.\r\nAt /source/.build/Assert-ValidStyle.ps1:21 char:11\r\n+ $issues = Invoke-ScriptAnalyzer -Path \"$PSScriptRoot\\..\" -Recurse\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : InvalidOperation: (/source/.build/powershell-helpers.psm1:String) [Invoke-ScriptAnalyzer], NullReferenceException\r\n+ FullyQualifiedErrorId : RULE_ERROR,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand\r\n```\r\n\r\nContents of powershell-helpers.psm1:\r\n```powershell\r\n# execute a command block and display stderr output without throwing powershell exceptions\r\n# Taken from https://mnaoumov.wordpress.com/2015/01/11/execution-of-external-commands-in-powershell-done-right\r\nfunction Invoke-Script {\r\n [CmdletBinding()]\r\n [Alias('exec')]\r\n param\r\n (\r\n [ScriptBlock] $ScriptBlock,\r\n [string] $StderrPrefix = \"\",\r\n [int[]] $AllowedExitCodes = @(0)\r\n )\r\n\r\n $backupErrorActionPreference = $script:ErrorActionPreference\r\n\r\n $script:ErrorActionPreference = \"Continue\"\r\n try {\r\n & $ScriptBlock *>&1 | ForEach-Object -Process `\r\n {\r\n if ($_ -is [System.Management.Automation.ErrorRecord]) {\r\n \"$StderrPrefix$_\"\r\n }\r\n else {\r\n \"$_\"\r\n }\r\n }\r\n\r\n if ($AllowedExitCodes -notcontains $LASTEXITCODE) {\r\n throw \"Execution failed with exit code $LASTEXITCODE\"\r\n }\r\n }\r\n finally {\r\n $script:ErrorActionPreference = $backupErrorActionPreference\r\n }\r\n}\r\n\r\nfunction Get-File {\r\n param(\r\n [string]$Uri,\r\n [string]$Path,\r\n [string]$Hash\r\n )\r\n\r\n New-Item -ItemType Directory -Path (Split-Path $path -Parent) -Force | Out-Null\r\n\r\n Invoke-WebRequest -Uri $uri -OutFile $path\r\n\r\n $actual = Get-FileHash -Path $path -Algorithm SHA256 | Select-Object -ExpandProperty Hash\r\n\r\n if ($actual -ne $hash) {\r\n throw \"File $path with hash $actual doesn't match expected hash $hash\"\r\n }\r\n}\r\n\r\nfunction Invoke-InDirectory {\r\n Param(\r\n [ValidateScript( { Test-Path $_ -PathType Container } )]\r\n [string]$Path,\r\n [ValidateNotNullOrEmpty()]\r\n [scriptblock]$ScriptBlock\r\n )\r\n\r\n Push-Location $Path\r\n try {\r\n &$ScriptBlock\r\n }\r\n finally {\r\n Pop-Location\r\n }\r\n}\r\n\r\nExport-ModuleMember -Alias * -Function *\r\n```\r\n","author":{"url":"https://github.com/chriskuech","@type":"Person","name":"chriskuech"},"datePublished":"2019-10-17T01:11:59Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/1351"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c53ba36e-611c-64c2-0899-d0aac70393be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E238:1DA8C8:15DA6:1D77E:6AFCE8C2 |
| html-safe-nonce | 074f729fdb87ab987af451f2a7c72342a0b55e3947e942931a63faa4f757dc9e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjM4OjFEQThDODoxNURBNjoxRDc3RTo2QUZDRThDMiIsInZpc2l0b3JfaWQiOiI4MTc1MjY3NTM1ODY0NTIyOTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 922c7aab97833d82fabdef9f43f1366ab0014826bd1359a7c18a0bb1d8f99266 |
| hovercard-subject-tag | issue:508176675 |
| 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/PSScriptAnalyzer/1351/issue_layout |
| twitter:image | https://opengraph.githubassets.com/73407edba9a215ec2c0248103ee3a744894128402ffbd7a3664f8fbcc4e31d18/PowerShell/PSScriptAnalyzer/issues/1351 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/73407edba9a215ec2c0248103ee3a744894128402ffbd7a3664f8fbcc4e31d18/PowerShell/PSScriptAnalyzer/issues/1351 |
| og:image:alt | I wish I could provide more information, but the error is transient and therefore cannot be deterministically reproed. PowerShell version: 6.2.1 PSScriptAnalyzer version: 1.18.3 OS Version: Ubuntu ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chriskuech |
| hostname | github.com |
| expected-hostname | github.com |
| None | 99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 33149177 |
| octolytics-dimension-repository_nwo | PowerShell/PSScriptAnalyzer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33149177 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSScriptAnalyzer |
| 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 | ecfd63ca125ec74b42f74eeb158b3fa081c8c497 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width