title: (Powershell) Ensure variable is interpreted as literal string
body: <p>I'm working on Powershell scripts to take a selection of AD principal names, pull full DNs for them, and take action on the accounts in question.
  The active parts are all working fine now, but I've run into an unfortunate problem - several of the AD objects have names that start with $, IE $DUPLICATE-c1870</p>
  
  <p>This means that when I output them to a variable, then read that variable in later, it tries to interpret the variable. For the time being I've bodged a fix by manually defining</p>
  
  <pre><code>$duplicate='$duplicate'
  </code></pre>
  
  <p>But that A: depends on that being the only such name and B: offends my sense of elegance.</p>
  
  <p>I'm fairly new to powershell, so it's entirely possible I'm missing something obvious, but I can't find a way to either add the single quotes to the string (because it's pulled from a variable itself) or to the insertion step.</p>
  
  <p>Relevant section of code follows:</p>
  
  <pre><code># Import AD Module 
  import-module ActiveDirectory
  # Define fake variable for edge cases
  $duplicate='$duplicate'
  # Import the data from CSV file and assign it to variable  
  $Imported_csv = Import-Csv -Path 
  "C:\scripts\ADremediation\threecomputers.csv" -delimiter ';' 
  
  $Imported_csv | ForEach-Object{ 
   # Retrieve DN of User. 
   $1=$_.PrincipalName
   Write-output $1 |timestamp
   $UserDN  = (Get-adcomputer -Identity $1).distinguishedName
   Echo $userDN
  </code></pre>