App-V 5; Enable or disable all debug-logs

Been diving into the App-V 5 logs for a few days and got tired of enabling the debug and analytic log files. Made a small sample to enable them in a loop;

Enable all App-V 5 logs;

##Nicke Källén 2013-05-08
##Enable all logs
$appvlogs = Get-WinEvent -ListLog *AppV* -force | Where-Object {$_.IsEnabled -eq $false}
foreach ($logitem in $appvlogs) {
     write-host “Log enabled: ” $logitem.LogName
     $logitem.IsEnabled = $true
     $logitem.SaveChanges()
}
##Disable all logs
$appvlogs = Get-WinEvent -ListLog *AppV* -force | Where-Object {$_.IsEnabled -eq $true}
foreach ($logitem in $appvlogs) {
if (($logitem.LogName -ne "Microsoft-AppV-Client/Admin") -or ($logitem.LogName -ne "Microsoft-AppV-Client/Operational") -or ($logitem.LogName -ne "Microsoft-AppV-Client/Virtual Applications"))
{
     write-host “Log Disabled: ” $logitem.LogName
     $logitem.IsEnabled = $false
     $logitem.SaveChanges()
}}

No error handling is available, this is just a quick start to avoid loads of clicking.

(2013-05-05 – Added the Where-object to avoid getting errors…)

App-V 5 Powershell Sequencing

Yeah – its pretty cool. Create a folder with the installation file named c:\source. As sample media VLC will be used. The installation-file is called; vlc-2.0.2-win32.exe

Run the following from Powershell to setup the sequencer cmdlets.

Set-Executionpolicy RemoteSigned
Import-module appvsequencer

Run the below to create two directories and then run through the installer.

$package = 'VLC'
new-item c:\source\$package -type directory
new-item c:\$package -type directory
New-AppvSequencerPackage -Name $package -Path c:\source\$package -Installer C:\source\vlc-2.0.2-win32.exe -PrimaryVirtualApplicationDirectory C:\$package –FullLoad

The final package gets created within c:\source\VLC