Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Does not work with Powershell 7 #41

Open
boostchicken opened this issue Aug 29, 2023 · 1 comment
Open

[BUG] Does not work with Powershell 7 #41

boostchicken opened this issue Aug 29, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@boostchicken
Copy link
Contributor

boostchicken commented Aug 29, 2023

Describe the bug
You get an error form C:"Program" when you try to run in powershell, this is because we are using shell: true which is a bad practice, all its doing is injecting a variable before our command

To Reproduce
Steps to reproduce the behavior:

Expected behavior
It usually execs aws config se whatever value a fews times THose calls are not working on Powershell 7

Screenshots
image
Environment (please complete the following information):

  • OS: Windows 11`
  • CLI Version (saml-to --version): `` 2.1.1-0

Additional context
Considerd using setx instead of set for the command output, it works in bothb pwsh and cmd, however it saves to the registry and wont take effective till new shell is made

@boostchicken boostchicken added the bug Something isn't working label Aug 29, 2023
@boostchicken boostchicken changed the title [BUG] [BUG] Does not work with PWSH and CMD Aug 29, 2023
@boostchicken boostchicken changed the title [BUG] Does not work with PWSH and CMD [BUG] Does not work with Powershell 7 Aug 29, 2023
@boostchicken
Copy link
Contributor Author

Implement my polyfill for set in pwsh for easy cmd and pwsh compat
#40 (comment)

if (test-path Alias:set) { Remove-Item -Path Alias:set }
function SET {
  [string] $var = $args
  if ($var -eq "")
  { Get-ChildItem -Path Env: }
  else {
    if ($var -match "^(\S*?)\s*=\s*(.*)$")
    { set-item -force -path env:$($matches[1]) -value $matches[2]; }
    else
    { write-error "ERROR Usage: VAR=VALUE" }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants