title: Manipulating a string in a text file via PowerShell to return a specific value
body: <p>I'm currently attempting to pull the version number out of an assemblyinfo.cs file and then append JUST the version number, 1.2.3.4, to another text file.</p>
  
  <p>I've attempted to use the .split() method, but that only works if the item is already a string(from what I've read) and I pull the entirety of the string from the text file by using <em>select-string</em></p>
  
  <p>Here's what I'm working with</p>
  
  <blockquote>
    <p>$a = cat "c:\path_to_file\AssemblyInfo.cs" | select-string AssemblyVersion</p>
  </blockquote>
  
  <p>Which will produce:    [assembly: AssemblyVersion("5.7.4.1")]</p>
  
  <p>And then if I try to do $a.split(' " ') I will get</p>
  
  <blockquote>
    <p>Method invocation failed because [System.Object[]] doesn't contain a method named 'split'.
    At line:1 char:21
    + $versionstring.split &lt;&lt;&lt;&lt; (' " ')
       + CategoryInfo          : InvalidOperation: (split:String) [], RuntimeException
       + FullyQualifiedErrorId : MethodNotFound</p>
  </blockquote>
  
  <p>Which as I said, is due to the fact that it's considered as an Object, not a string.</p>
  
  <p>The result that I want is like this though:</p>
  
  <pre><code>PS C:\&gt; $a = '[assembly: AssemblyVersion("5.7.4.1")]'
  $b = $a.split(' " ')
  $b[2]
  5.7.4.1
  </code></pre>
  
  <p>I'm assuming the issue is regarding the fact that I'm using CAT to display the contents and then pull the string, I'm not sure.</p>