Friday, August 7, 2015

XenApp 6.5 published Windows Explorer using powershell

based on http://support.citrix.com/article/CTX131423

Using a Batch launcher for flexibility to run a powershell script instead of autoit.

[ExplorerLauncher.cmd]
@echo off
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -executionPolicy bypass -file "C:\Program Files\AppScripts\ExplorerLauncher.ps1"
exit

[explorerlauncher.ps1]

#$Process = [Diagnostics.Process]::Start("notepad")
$process = Start-Process notepad -WindowStyle Minimized -PassThru
$id = $Process.Id
Write-Host "Pre-Launch Process created. Process id is $id"
Write-Host "sleeping for 2 seconds"
Start-Sleep -Seconds 2
Write-Host "Loading explorer"
Start-Process "Explorer" -ArgumentList "Z:\"
Write-Host "sleeping for 2 seconds"
try {
Stop-Process -Id $id -ErrorAction stop
Write-Host "Successfully killed the process with ID: $ID"
} catch {
Write-Host "Failed to kill the process"
}
Start-Sleep -Seconds 2
Write-host "Exiting Launch completed"
exit

Saturday, August 1, 2015

windows 10 | cleanups debloat

if you dare...

follow this
- https://www.reddit.com/r/Windows10/comments/3f38ed/guide_how_to_disable_data_logging_in_w10/


my Debloat script...
Help from
- http://blogs.technet.com/b/deploymentguys/archive/2013/10/21/removing-windows-8-1-built-in-applications.aspx
- https://www.reddit.com/r/Windows10/comments/3diylq/powershell_commands_to_uninstall_unwanted_builtin/

#
# Cleans up Windows 10 Bloatware... Perform at your own risk :) !
#

$Removelist=@"
Microsoft.BingFinance                   
Microsoft.BingWeather
Microsoft.BingNews
Microsoft.Windows.Photos                
Microsoft.WindowsCamera
Microsoft.XboxApp                       
Microsoft.ZuneMusic                     
microsoft.windowscommunicationsapps
Microsoft.SkypeApp                      
Microsoft.ZuneVideo                     
Microsoft.WindowsSoundRecorder          
Microsoft.WindowsScan                   
Microsoft.WindowsReadingList            
Microsoft.WindowsPhone                  
Microsoft.WindowsMaps                   
Microsoft.Reader                        
Microsoft.People                        
Microsoft.Office.OneNote                
Microsoft.MicrosoftSolitaireCollection  
Microsoft.MicrosoftOfficeHub            
Microsoft.BingTravel                    
Microsoft.BingSports                    
Microsoft.BingHealthAndFitness          
Microsoft.BingFoodAndDrink
#Microsoft.3DBuilder
"@

$removelist=$Removelist.split("`n")

ForEach ($App in $removeList){

$app=$App.Trim()

$Packages = Get-AppxPackage | Where-Object {$_.Name -eq $App}

if ($Packages -ne $null){

Write-Host "Removing Appx Package: $App"

foreach ($Package in $Packages)

{

Remove-AppxPackage -package $Package.PackageFullName 

}

}

else

{

Write-Host "Unable to find package: $App"

}

$ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object {$_.displayName -eq $App}

if ($ProvisionedPackage -ne $null)

{

Write-Host "Removing Appx Provisioned Package: $App"

remove-AppxProvisionedPackage -online -packagename $ProvisionedPackage.PackageName 

}

else

{

Write-Host "Unable to find provisioned package: $App"

}

}