title: Powershell - Cannot validate argument on parameter 'Name'. The number of characters (0) in the argument is too small
body: <p>Its my first day with powershell scripting
  I am trying using VMM Cmdlet Get-SCVirtualMachine
  it works fine when I use it like </p>
  
  <pre><code>PS C:\&gt; $VM = Get-SCVirtualMachine -Name "VM01"
  </code></pre>
  
  <p>But it gives me an error when I try</p>
  
  <pre><code>PS C:\&gt; $vmName = 'VM01'
  PS C:\&gt; $VM = Get-SCVirtualMachine -Name "$vmName"
  </code></pre>
  
  <p>The error I get is </p>
  
  <blockquote>
    <p>Cannot validate argument on parameter 'Name'. The number of characters
    (0) in the argument is too small. Specify an argument whose length is
    greater than or equal to "1" and then try the command again.</p>
  </blockquote>
  
  <p>Can someone tell me what is it that I am doing wrong?</p>
  
  <p>Thanks</p>