How to make an api call to an url with ‘&’ in the folder name

Welcome Forums General PowerShell Q&A How to make an api call to an url with ‘&’ in the folder name

Viewing 1 reply thread
  • Author
    Posts
    • #235432
      Participant
      Topics: 11
      Replies: 9
      Points: 110
      Rank: Participant

      Hi All,

      I am able to read values from below url with folder having space (Ex:This That)
      $qaprivkey = .\vault.exe read -field="privatekey" "secret/parentfolder/childfolder/This That/api"
      write-Host "privatekey is" $qaprivkey
      Output : privatekey is xyz-asd-qwe-sdf
      Please suggest how can i read values from below url with folder having & (Ex:M & M)
      API call is not able to read value with folder name having ‘&’
      Considering folder name cannot be changed , Please provide your suggestions
      $qapubkey = .\vault.exe read -field="publickey" "secret/parentfolder/childfolder/M & M/api"
      write-Host "publickey is" $qapubkey
      Output : No value found at secret/parentfolder/childfolder/M & M/api
      • This topic was modified 3 weeks, 4 days ago by pk30.
      • This topic was modified 3 weeks, 4 days ago by pk30.
    • #235447
      Participant
      Topics: 5
      Replies: 2372
      Points: 6,005
      Helping Hand
      Rank: Community MVP

      Have you tried single quotes? … or escaping the “&”?

Viewing 1 reply thread
  • You must be logged in to reply to this topic.