PowerShell: App-V Suite-In-Place
A powershell script to suite two applications in the local OSD cache, for testing interaction and hotfixing a user if need be. At some point I may update it to accept arguments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | $offcGuid = "22C76228-3DF0-48DD-853C-77FDC955CC86" $sGuid = "F5B20FA7-E437-4E03-885B-3D5B67F3DC22" $sParam = "" $sFile = "%CSIDL_PROGRAM_FILES%\Microsoft Analysis Services\AS Excel Client\10\Microsoft.AnalysisServices.AtomLauncher.exe" $sGuard = "POWPIVOT.1\osguard.cp" $sSize = "323267785" $sMand = "FALSE" $path = "C:\ProgramData\Microsoft\Application Virtualization Client\SoftGrid Client\OSD Cache\" $dir = Get-ChildItem $path $list = $dir | where {$_.extension -eq ".osd" } foreach ( $i in $list ) { [xml] $xml = gc ( $path + $i ) if( $xml .SOFTPKG.IMPLEMENTATION.CODEBASE.GUID -eq $offcGuid ) { $final = ( $path + $i ) [xml] $excel = gc $final $newitem = $excel .CreateElement( "CODEBASE" ) $newitem .SetAttribute( "HREF" , $sPath ) $newitem .SetAttribute( "GUID" , $sGuid ) $newitem .SetAttribute( "PARAMETERS" , $sParam ) $newitem .SetAttribute( "FILENAME" , $sFile ) $newitem .SetAttribute( "SYSGUARDFILE" , $sGuard ) $newitem .SetAttribute( "SIZE" , $sSize ) $newitem .SetAttribute( "MANDATORY" , $sMand ) $excel .SOFTPKG.IMPLEMENTATION.VIRTUALENV.DEPENDENCIES.AppendChild( $newitem ) $excel .Save( $final ) } } |