Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] Third Party Tools (https://www.kinook.com/Forum/forumdisplay.php?f=3)
-   -   PowerShell script gives object required error (https://www.kinook.com/Forum/showthread.php?t=5190)

rnauman 07-16-2013 12:52 PM

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 '(? $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 '(? $matchCount = 0
if ($matches -is ) {
And here's the powershell version:

Code:

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


kinook 07-16-2013 01:44 PM

Double up the square bracket characters.
http://www.kinook.com/VisBuildPro/Ma...ershelltab.htm

rnauman 07-17-2013 06:46 AM

Ah, perfect. Thanks


All times are GMT -5. The time now is 06:42 AM.


Copyright © 1999-2023 Kinook Software, Inc.