Executing a VSTS/TFS build via PowerShell

This script queues a build in VSTS/TFS, based on the build definition ID or the build definition name and waits until the build completes.

Targets:

Visual Studio Team Services
Team Foundation Services

The script can be viewed on Gist:

Getting tags from a VSTS/TFS build via PowerShell

This script gets the tags associated with a specific build in TFS/VSTS. Authentication can be performed using the current users credentials, a personal access token, or system OAUTH.

Targets:

Visual Studio Team Services
Team Foundation Services

The script can be viewed on Gist:

Adding tags to a VSTS/TFS build via PowerShell

This script adds a tag or tags to a specific build in TFS/VSTS. Authentication can be performed using the current users credentials, a personal access token, or system OAUTH.

Targets:

  • Visual Studio Team Services
  • Team Foundation Services

The script can be viewed on Gist:

Found an old dos disk (win98)

Was going through some old files, and found an old win98 boot disk that I made when I worked in graphics at Intel. I got bored, so I used ANSI.SYS to make a cool boot logo.

 

Jeff Block’s DOS Boot Disk – Windows Startup Menu

 

Jeff Block’s DOS Boot Disk – Startup splash screen using ANSI.SYS

 

Jeff Block’s DOS Boot Disk – Menu using ANSI.SYS

 

 

Unequal payload attributes error while upgrading VMware ESXi 5.5 Update 2 using the HP custom image

I recently attempted to update some servers to the new HP custom image for VMware ESXi (VMware-ESXi-5.5.0-Update2-2403361-HP-550.9.2.27-Mar2015.iso) and since have had issues scanning these hosts using VMware vSphere Update Manager.

After adding this ISO to the update manager repository the Scan and Remediate tasks will fail with “Cannot execute upgrade script on host.”

I get the following in the update manager log file:

WARNING:root:Couldn't load esximage database: Cannot merge VIBs Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560, Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560 with unequal payloads attributes: ([net-mst: 8.250 KB], [net-mst: 8.242 KB]). Host may be incorrect version.

and

ValueError: Cannot merge VIBs Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560, Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560 with unequal payloads attributes: ([net-mst: 8.250 KB], [net-mst: 8.242 KB])

Running an upgrade manually with an ISO will also fail with the same message.

Workaround

  1. Log into the ESXi host using SSH
  2. Verify that none of the network adapters are using the Mellanox driver. This command should return no results:
    ~ # esxcli network nic list | grep net-mst
  3. Remove the net-mst VIB:
    ~ # esxcli software vib remove -n net-mst

    Which results in this message:

    Removal Result
       Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
       Reboot Required: true
       VIBs Installed:
       VIBs Removed: Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560
       VIBs Skipped:
  4. Reboot the system and Scan/Remediate again in Update Manager, or upgrade the system via the ISO.

Repeat a character in windows batch

This batch code will repeat a character a number of times.

It works in all modern versions of Windows.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: CharRepeat
:: Repeats a character a specified number of times.
::
:: Arguments:
::  %1  ResultVar       The name of the environment variable that is populated
::                      with the result.
::  %2  Character       The character to repeat.
::  %3  Count           The number of times to repeat <character>.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:CharRepeat <resultvar> <character> <count>
SET "%~1="
FOR /L %%I IN (1,1,%~3) DO SET "%~1=!%~1!%~2"
GOTO:EOF

You can use the code like so:

Call :CharRepeat RepeatedChar * 10
ECHO %RepeatedChar%
Call :CharRepeat RepeatedChar " " 10
ECHO %RepeatedChar%
Call :CharRepeat RepeatedChar _ 15
ECHO %RepeatedChar%
Output:
**********

_______________
Hope this is useful.

Timeout Utility

Update (04/09/2013) – v1.0.2 released.

While working on a batch script for MS-DOS, I was looking for a utility similar to Timeout.exe (originally provided in the NT 4.0 Resource Kit, currently provided with Windows) for Microsoft DOS and the Windows ME version of DOS. I was unable to find anything that suited my needs, so I put one together. This utility compares to Timeout.exe, Wait.exe, Delay.exe and Pause.exe. This allows you to put a timed delay into a batch script without resulting to using tricks with Choice or Ping. The 16-bit version of this application will run on MS-DOS v3.3+, the Windows version will run on any version of Windows. The Linux version should run on any version of Linux.

Timeout v1.0.2
This utility accepts a timeout parameter to wait for the specified time period (in seconds) or until any key is pressed. It also accepts a parameter to ignore the key press.

TIMEOUT [/T timeout] [/NoBreak] [/Q] [/NoLogo]
/?           Displays this help message.
/T, /timeout Specifies the number of seconds to wait.
Valid range is -1 to 99999 seconds.
/NoBreak     Ignore key presses and wait the specified time.
/NoLogo      Does not display application logo.
/Q, /quiet   Does not output any text during execution.

The files can be downloaded here:

Documentation:

This release has been tested on the following Operating Systems:

  • MS-DOS 6.22
  • FreeDOS 1.1
  • DOSBox 0.74
  • Windows 7
  • Windows 8
  • Ubuntu 12.10

Change log:

v1.0.2 – April 9, 2013
– [ADD] (4) Linux support for NosCLU
– [FIX] (6) Logo should not be displayed with Quiet switch
– [FIX] (8) Extra Line is generated running with /q quiet argument
– [FIX] (9) Timeout output can not be logged to a file
– [FIX] (10) Timeout parameter causes Segmentation fault in Linux

v1.0.1 – March 2, 2013
– [FIX] (1) Ctrl+C Combination does not work under MS-DOS

v1.0.0 – February 24, 2013
– Initial Version

Please comment below if you have any comments or suggestions.

First Post!

Hopefully this blog will serve as a central spot to share tools I have created and ideas that I have.

Look for more information coming soon…