Pages

Friday 6 July 2012

Running powershell scripts on Windows



Why do you get weird error messages when you try to run a script? That’s easy. The security settings built into Windows PowerShell include something called the “execution policy;” the execution policy determines how (or if) PowerShell runs scripts. By default, PowerShell’s execution policy is set to Restricted; that means that scripts - including those you write yourself - won’t run. Period.

Note. You can verify the settings for your execution policy by typing the following at the PowerShell command prompt and then pressing ENTER:

Get-ExecutionPolicy
suppose you want to configure PowerShell to run - without question - any scripts that you write yourself, but to run scripts downloaded from the Internet only if those scripts have been signed by a trusted publisher. In that case, use this command to set your execution policy to RemoteSigned:
Set-ExecutionPolicy RemoteSigned
Alternatively, you can set the execution policy to AllSigned (all scripts, including those you write yourself, must be signed by a trusted publisher) or Unrestricted (all scripts will run, regardless of where they come from     and whether or not they’ve been signed).

Regardless of your location within the file system. It doesn’t matter if you’re in C:\Scripts; you still need to type the following:
C:\Scripts\Sample.ps1

Convert Legacy AppV Package to AppV 5.0 format



Following Powershell command should be used to convert AppV packages developed using AppV 4.6SP1 or less TO AppV 5.0 format.


ConvertFrom-LegacyAppvPackage -source "{legacy pkgs}" -target "{vnext pkgs}"


where {legacy pkgs} and {v.Next pkgs} represent the path to the associated packages.



Sftmime and App-V 5.0 BetaPowerShell cmdlets


The following table displays the sftmime functions available with previous versions of App-V 5.0 Beta and the App-V 5.0 Beta PowerShell equivalent:




To install the App-V 5.0 BetaPowerShell Cmdlets




1. To use the Server App-V PowerShell Cmdlets open an elevated PowerShell cmd prompt and import the modules by running one of the following commands:


2. To load the Server App-V client cmdlets, type:
           PS C:\> Import-Module AppVClient
    To load the Server App-V server cmdlets, type:
           PS C:\> Import-Module AppVServer
    To load the Server App-V sequencer cmdlets, type:
           PS C:\> Import-Module AppVSequencer
    To load the Server App-V package converter cmdlets, type:
           PS C:\> Import-Module AppVConverter




AppV 5.0 Client GUI



AppV Client Interface in version 5.0 has changed to resemble Windows 8 tiles




Available AppV packages are visible as displayed below, we can find if its a offline package or streamed and also has the option to reset/repair user state.




The location where AppV package content is stored is C:\ProgramData\AppV\[PackageID]




Command to Hide/Unhide a File



Command to Hide: Attrib +h "PathofFile"


Command to Unhide: Attrib -h "PathofFile"


Thursday 5 July 2012

AppV 5.0 Package Output


Sequencer output in AppV 5.0 has changed a lot, following are no more available

  • No OSDs
  • No sft file
  • No Icons file
New output contains:
  • .appv file
  • .xml files ( DeploymentConfig.xml and UserConfig.xml)
  • .msi file (report.xml)
Packages developed using AppV versions below 5 are to be converted to AppV 5 format, ( there is no native support of AppV 4.6 or below sequenced packages in AppV 5)

Screenshot of sample AppV 5 package output


When you use the sequencer to create a new virtual application, the following list displays the files that are created and comprise the App-V 5.0 Beta package:
  • .MSI – this Windows Installer (.msi) file is created by the sequencer and is used to install the virtual package on target computers.
  • Report.xml - the sequencer saves all issues, warnings, and errors that were discovered during sequencing and displays the information after the package has been created. You can us this report for diagnosing and troubleshooting.
  • .appv file - the virtual application.
  • Deployment configuration file - the deployment configuration file determines how the virtual application will be deployed to target computers.
  • User configuration file - the user configuration file determines how the virtual application will run on target computers.