title: How to run base64 code in powershell with ascii?
body: <p>I would like to run command <code>mkdir C:\Temp\555</code> in Powershell via a Base64-encoded <em>string</em>.</p>
  
  <p>This code should work</p>
  
  <pre><code>$4 = "bWtkaXIgQzpcVGVtcFw1NTU="
  
  $code = [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($4))
  
  powershell $code
  </code></pre>
  
  <p>but if i convert <code>$code</code> to ASCII, how can I run it like that, because this one won't work:</p>
  
  <pre><code>$4 = "bWtkaXIgQzpcVGVtcFw1NTU="
  
  $code = [char]091+[char]084+[char]101+[char]120+[char]116+[char]046+[char]069+[char]110+[char]099+[char]111+[char]100+[char]105+[char]110+[char]103+[char]093+[char]058+[char]058+[char]085+[char]116+[char]102+[char]056+[char]046+[char]071+[char]101+[char]116+[char]083+[char]116+[char]114+[char]105+[char]110+[char]103+[char]040+[char]091+[char]067+[char]111+[char]110+[char]118+[char]101+[char]114+[char]116+[char]093+[char]058+[char]058+[char]070+[char]114+[char]111+[char]109+[char]066+[char]097+[char]115+[char]101+[char]054+[char]052+[char]083+[char]116+[char]114+[char]105+[char]110+[char]103+[char]040+[char]036+[char]052+[char]041+[char]041
  
  powershell $code
  </code></pre>
  
  <p>because the last code doesn't work while the first one does, any help please?</p>