App-V 5 and duplicate package GUIDs

An associate of mine recently discovered that we had two App-V 5 packages with the same GUID. This was not a case of mistakenly adding onto an existing package or anything weird like that. These were two new sequences made by reverting the snapshot on the virtual machine back to clean. This was a strange predicament because these are supposed to be randomly generated GUIDs with little chance of ever coming across the same GUID again. As we dug into it some more, we found two more packages with similar GUIDS, but different from the first. In total we have four sequences in our library that had duplicate GUIDs.

A quick search of the interwebs brought us to an article by Tim Mangan (godfather of App-V). I recommend anyone that will be sequencing applications read that article, but to sum up- Don’t take a snapshot of your virtual machine with it powered on. Make sure your snapshots are taken with the machine powered off. This will ensure the seed that creates the unique GUID will be different than the one that was saved in your snapshot. It may add a few seconds to your process, but its worth it in the end to avoid this issue.

Read more here: TMurgent

Batch and Powershell sleep commands

Sometimes when creating a script, you may need the script to wait or sleep for a certain period of time.

Batch Scripts:

If you search the interwebs, you will find a lot of workarounds that involve pinging a network address for a certain number of times. While this gets the job done, it isn’t necessarily the most straightforward way.

Luckily, there is another command that allows you to specify a wait time in seconds. This command is called timeout, which is something you are probably familiar with if you have kids. It does exactly what it sounds like, it sits there and waits for the number of seconds you specify. Or if you want the Microsoft definition: 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.

According to Microsoft, the command applies To: Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista, Windows XP.

So I am curious why this isn’t more widely used.

PowerShell:

Although you can use the same command with PowerShell, you may want to take advantage of a new command called Start-Sleep. The Start-Sleep cmdlet suspends the activity in a script or session for the specified period of time. You can use it for many tasks, such as waiting for an operation to complete or pausing before repeating an operation.

Find more on these commands here:
Timeout
Start-Sleep