title: bcdedit, bcdstore and powershell
body: <p>so i can write bcd commands in a powershell script as if i were in a cmd prompt, for example:</p>
  
  <pre><code>bcdedit /default '{current}'
  </code></pre>
  
  <p>however i need a script that does this:</p>
  
  <pre><code>bcdedit /default '{current}'
  bcdedit /set '{otherboot}' description "my description"
  </code></pre>
  
  <p>if it didnt do that, it would be the other way around:</p>
  
  <pre><code>bcdedit /default '{otherboot}'
  bcdedit /set '{current}' description "my description"
  </code></pre>
  
  <p>what i need to do is find the identifier of the other boot in powershell and im not sure how.  all google searches say to do this:</p>
  
  <pre><code>$bcdStore=gwmi -name root\wmi -list bcdstore -enableall
  $bcdStore|gm
  $result=$bcdStore.OpenStore("") # can also use explicit file name.
  $store=$result.Store
  </code></pre>
  
  <p>but i have no idea how to use the store once i have it and this seems a little too complicated. i mean there should be an easier way... no?</p>