I don't think you can use an external command for this since you're deploying to a Windows server. Why not create a separate NSH script and batch the two together?
When you are performing an external command in a BLPackage, it is running in the native command processor, which is cmd.exe for Windows.
In windows, the native FIND command can search standard input. Windows find is closer to NSH grep than it is to NSH find.
The following works with the output you identified, replace cat output with the gacutil command. Google "cmd scripting" for more examples.
for /f "tokens=5" %%c in ('cat output ^| find "Number of items"') do echo C: %%c & if "%%c"=="0" goto NoneFound
echo No instances found.
REM Instructions to install go here.
try something like
for /f tokens=a-e usebackq %%a in (`gacutil /l "
basically you need to assign a variable to the output of "Number of Items = X"
then compare the last variable to whatever you need it to be...
oh yeah - robin - clean up your inbox so i can send you the jumpstart stuff....
Brad suggested I include grep.exe and awk.exe in the blpackage from a local nsh installation.
I've tried this on my laptop and it works well. I didn't know that pipe would work under windows, but it does.
I'm going to try this on my client's installation soon, and I'll post results here.
Nice - plus you could also add a command at the end to remove both exe's to clean things up afterwards.
OK, so piping my command through grep & awk works, but now my problem is grabbing that output in an IF statement. Setting it to a variable would work.
Anyway, Andrew's (and Bill's) scriptlet works, so I'll use that.
yeah - stick to the native commands. it's more portable.