Advertisement
Guest User

Script corrupted by PowerGUI Script Editor 3.0.0

a guest
Jul 22nd, 2011
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PS C:\Users\johan.andersson> cat S:\Scripts\Build\get-assemblyversion.ps1
  2. <#
  3. .SYNOPSIS
  4.         Reads the AssemblyVersion attribute from a .CS file and returns an object consisting of the version
  5. .DESCRIPTION
  6.         Specify the path to the .CS file
  7. #>
  8. param( [string] $assemblyInfoFile )
  9.  
  10. $version = "" | select Major, Minor, Build, Revision
  11.  
  12. gc $assemblyInfoFile | %{
  13.         if( $_ -match "AssemblyVersion(Attribute)?\s*\(\s*`"([0-9]+).([0-9]+).([0-9]+).([0-9]+)`"\s*\)" ) {
  14.                 $version.Major = $matches[2]
  15.                 $version.Minor = $matches[3]
  16.                 $version.Build = $matches[4]
  17.                 $version.Revision = $matches[5]
  18.         }
  19. }
  20.  
  21. $versionmatch "AssemblyVersion(Attribute)?\s*\(\s*`"([0-9]+).([0-9]+).([0-9]+).([0-9]+)`"\s*\)" ) {
  22.                 $version.Major = $matches[2]
  23.                 $version.Minor = $matches[3]
  24.                 $version.Build = $matches[4]
  25.                 $version.Revision = $matches[5]
  26.         }
  27. }
  28.  
  29. $versionatches[2]
  30.                 $version.Minor = $matches[3]
  31.                 $version.Build = $matches[4]
  32.                 $version.Revision = $matches[5]
  33.         }
  34. }
  35.  
  36. $versionsion5]
  37.  
  38.         }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement