Video Screencast Help

SWV LayerInfo

Created: 17 Sep 2012 • Updated: 17 Sep 2012 | 1 comment
AngelD's picture
+2 2 Votes
Login to vote

I often need to fetch the ID or Name of a layer (file) without having the SWV agent installed so instead of open up the compressed VSA/XPF/VPA and reading the info from the file(s) I created this powershell script to show the information and hope you will have use for it as I have.

Requirements

The Ionic.Zip.dll file needs to be in the same folder as the powershell script and is used to open the compressed VSA, XPF or VPA file and to enumerate the files until we find the file(s) containing the information we want.

  • PowerShell Script Execution Policy

The script is not signed so the execution policy therefore needs to be set to unrestricted. If not it will "bomb out" with the error message "SWV_LayerInfo.ps1 cannot be loaded because the execution of scripts is disabled on this system."

To set the policy to unrestricted execute the below command in an elevated command prompt (cmd.exe)

powershell Set-ExecutionPolicy Unrestricted

For more information refer to Using the Set-ExecutionPolicy Cmdlet

 

The attached SWV_LayerInfo.zip contains two files: the powershell script (SWV_LayerInfo.ps1) and a batch file (SWV_LayerInfo.cmd) that I have a pinned shortcut to to easy execute the script from the start menu.

Output examples

  • VSA/XPF

 

#### Layer Information ####
Name: Mercur Solutions BusinessControl 6.3
ID: 3ca502a2-2afb-46d2-8c93-42c9dc7e46a3
Type: 0 (Application)
###########################
 
#### Layer Details ####
MajorVersion: 2
MinorVersion: 7
Format: .vsa
Architecture: AMD64
PeerID: c617f6c7-8447-4ed2-bde9-431ed7a0166c
#######################
 
Press any key to continue . . .
 
 
  • VPA
#### Patch Information ####
Name: Mercur Solutions BusinessControl 6.3.1
ID: 2264bbe4-e2f7-473e-b031-ddb8501c7aa8
 
#### Applies to Layer ####
Name: Mercur Solutions BusinessControl 6.3
ID: 3ca502a2-2afb-46d2-8c93-42c9dc7e46a3
 
#### OS Version ####
MajorVersion: 6
MinorVersion: 1
BuildVersion: 7600
PlatformID: 2
Misc:
 

 

Comments 1 CommentJump to latest comment

AngelD's picture

Here is a nice way to manage the "Execution Policy" in addition to setting the policy if you want to add that the script.

Bypassing Restricted Execution Policy in Code or in Script

 

+1
Login to vote