Closed accc703 closed 4 years ago
Looks like the build failed due to 'PSAvoidTrailingWhitespace' Not sure which line, but one of them has some extra whitepsace.
Line 9, 43
Line 9, 43
Just removed the whitespace at the line mentioned
https://ci.appveyor.com/project/JustinSider/restps/builds/32584653
hmm, still missing something. I'm on my phone, so I can't take a look now. you can run scriptanalyzer locally on that file to get the exact lines.
https://ci.appveyor.com/project/JustinSider/restps/builds/32584653
Thank you. I am totally new on github
Github can be tricky! - I'm happy having folks conrtibute! Instead of doing a foreach loop. What about doing a where, that way you can limit it to one check. `# Untested
$RequestUserName,$RequestPass = $DecodedAuthString -split (":") $AllowedUser = $RestUserAuth | Where-Object {$_.UserName -eq "$RequestUserName"}
If(($AllowedUser | Measure-Object).Count -eq 1) {
} else {
}`
Measure-Object
If using WHERE, would the following code logically correct, by checking the username and password at the same line?
$AllowedUser = $RestUserAuth | Where-Object {($.UserName -eq "$RequestUserName") -And ($.SystemAuthString -eq "$RequestPass)} If(($AllowedUser | Measure-Object).Count -eq 1) { $script:VerifyStatus = $true } else { $script:VerifyStatus = $false }`
In theory, yes! - But it would need to functionally be tested.
Let me try to program and test, and create pull again.
Decode the Authorization header, and compare the user records in Get-RestUserAuth.ps1