Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-16-2013, 12:52 PM
rnauman rnauman is online now
Registered User
 
Join Date: 07-16-2013
Posts: 3
PowerShell script gives object required error

I've created a powershell task and checked the script radio with this script:

Code:
$matches = Select-String %PROCFILES_FULLPATH% -Pattern '(?<!cfg)\.DEBUG' -CaseSensitive
$matchCount = 0
if ($matches -is [system.array]) {
  $matchCount = $matches.Count
} else {
  $matchCount = $matches.Matches.Count
}
if ($matchCount -gt 0) {
  "##teamcity[message text='Warning! " + $matchCount + " matches of non `cfg.` prefixed DEBUG statements were found! This could result in minified build errors' status='WARNING']"
}
I get the following error when running this task:

Quote:
Error expanding macros or script in property CmdStr: $matches = Select-String D:\TruCode_JSBuild\repository\Source\TruCode.Web.U I.Controls\js\controls\codebooks\views\tabular.ts -Pattern '(?<!cfg)\.DEBUG' -CaseSensitive
$matchCount = 0
if ($matches -is <Error at Line 1, Column 1 (Object required: 'system')>) {
And here's the powershell version:

Code:
Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1

Last edited by rnauman; 07-16-2013 at 12:59 PM.
Reply With Quote
  #2  
Old 07-16-2013, 01:44 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Double up the square bracket characters.
http://www.kinook.com/VisBuildPro/Ma...ershelltab.htm
Reply With Quote
  #3  
Old 07-17-2013, 06:46 AM
rnauman rnauman is online now
Registered User
 
Join Date: 07-16-2013
Posts: 3
Ah, perfect. Thanks
Reply With Quote
Reply

Tags
powershell


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:11 PM.


Copyright © 1999-2023 Kinook Software, Inc.