0

in the terminal

enter image description here

set TOKEN=Bearer allthebest

when I use Get-Variable to confirm my input,

I get TOKEN=Bearer as the variable name and allthebest as the value.

I expect TOKEN as the name and Bearer allthebest as the value.

mklement0
  • 382,024
  • 64
  • 607
  • 775
  • As an aside, I would set the token to allthebest and use an f-string to prepend Bearer unless there was some compelling reason to not do that. – JonSG May 11 '23 at 15:43
  • 1
    In short: While trying to use `cmd.exe` syntax `set FOO=BAR` to define an environment variable happens to work _syntactically_ in PowerShell, it does something very different. The real PowerShell equivalent is `$env:FOO = 'BAR'`. See the linked duplicate for details. – mklement0 May 11 '23 at 15:54
  • 1
    I've done it for this post, but please [format your posts properly](https://stackoverflow.com/help/formatting) in the future. – mklement0 May 11 '23 at 15:57

0 Answers0