├── Logon ├── ProjectLibre.txt ├── Microsoft Project.txt ├── Logon.ps1 ├── Microsoft Edge.txt ├── Adobe Acrobat Reader.txt └── Adobe Acrobat.txt ├── Chocolatey-Packages └── jre8 │ ├── tools │ ├── config │ │ ├── exception.sites │ │ ├── deployment.config │ │ └── deployment.properties │ ├── chocolateyUninstall.ps1 │ └── chocolateyInstall.ps1 │ ├── jre8.8.0.211.nupkg │ └── jre8.nuspec ├── Logoff └── Logoff.ps1 ├── Start Layout ├── Sign out.ico └── StartLayout.xml ├── Citrix ├── Reset-WEMCache │ ├── Reset-WEMCache.xml │ ├── README.md │ └── Reset-WEMCache.ps1 ├── Start-FileCaching │ ├── Start-FileCaching.xml │ ├── README.md │ └── Start-FileCaching.ps1 └── Repair-PublishedDesktopNames │ └── Repair-PublishedDesktopNames.ps1 ├── Update-PolicyDefinitions ├── Citrix_2303.zip ├── MicrosoftLAPS.zip ├── MicrosoftDefenderATP.zip └── Update-PolicyDefinitions.xml ├── IEMode └── SitesList.xml ├── .github └── dependabot.yml ├── Internet Explorer └── Get-InternetExplorer-TPList.ps1 ├── Get-MicrosoftDefenderUpdates ├── Get-MicrosoftDefenderUpdates.xml └── Get-MicrosoftDefenderUpdates.ps1 ├── StartMenu └── Reset-StartMenu.ps1 ├── VMware └── Set-CitrixvSpherePermissions ├── File Associations ├── Win10_PhotoViewer+Foxit.xml ├── WinServer_PhotoViewer+AdobeAcrobat.xml ├── Win10_PhotoViewer+AdobeAcrobat.xml ├── PhotoViewer.reg ├── Win2019_ImageGlass+AdobeAcrobat.xml ├── Win10_ImageGlass+AdobeAcrobat.xml ├── Win11_Multi_Default.xml └── Win10_ImageGlass+VLC.xml ├── Optimize-DefaultUserProfile └── Set-NewUserProfile.ps1 └── Startup └── Startup.ps1 /Logon/ProjectLibre.txt: -------------------------------------------------------------------------------- 1 | # ProjectLibre 2 | .mpp, ProjectLibreFile.1 3 | -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/tools/config/exception.sites: -------------------------------------------------------------------------------- 1 | https://yourdomain.com -------------------------------------------------------------------------------- /Logon/Microsoft Project.txt: -------------------------------------------------------------------------------- 1 | # Microsoft Project 2 | .mpp, MSProject.Project.9 3 | -------------------------------------------------------------------------------- /Logon/Logon.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Logon/Logon.ps1 -------------------------------------------------------------------------------- /Logoff/Logoff.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Logoff/Logoff.ps1 -------------------------------------------------------------------------------- /Start Layout/Sign out.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Start Layout/Sign out.ico -------------------------------------------------------------------------------- /Citrix/Reset-WEMCache/Reset-WEMCache.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Citrix/Reset-WEMCache/Reset-WEMCache.xml -------------------------------------------------------------------------------- /Update-PolicyDefinitions/Citrix_2303.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Update-PolicyDefinitions/Citrix_2303.zip -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/jre8.8.0.211.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Chocolatey-Packages/jre8/jre8.8.0.211.nupkg -------------------------------------------------------------------------------- /Update-PolicyDefinitions/MicrosoftLAPS.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Update-PolicyDefinitions/MicrosoftLAPS.zip -------------------------------------------------------------------------------- /Citrix/Start-FileCaching/Start-FileCaching.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Citrix/Start-FileCaching/Start-FileCaching.xml -------------------------------------------------------------------------------- /Update-PolicyDefinitions/MicrosoftDefenderATP.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JonathanPitre/Scripts/HEAD/Update-PolicyDefinitions/MicrosoftDefenderATP.zip -------------------------------------------------------------------------------- /Logon/Microsoft Edge.txt: -------------------------------------------------------------------------------- 1 | # Microsoft Edge 2 | .pdf, MSEdgePDF 3 | .pdfxml, MSEdgePDF 4 | .fdf, MSEdgePDF 5 | .xfdf, MSEdgePDF 6 | .xdp, MSEdgePDF 7 | .pdx, MSEdgePDF -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/tools/config/deployment.config: -------------------------------------------------------------------------------- 1 | deployment.system.config = file:\\C:\\WINDOWS\\Sun\\Java\\Deployment\\deployment.properties 2 | deployment.system.config.mandatory=true 3 | -------------------------------------------------------------------------------- /Logon/Adobe Acrobat Reader.txt: -------------------------------------------------------------------------------- 1 | # Adobe Acrobat Reader 2 | .pdf, AcroExch.Document.DC 3 | .pdfxml, AcroExch.pdfxml 4 | .acrobatsecuritysettings, AcroExch.acrobatsecuritysettings 5 | .fdf, AcroExch.FDFDoc 6 | .xfdf, AcroExch.XFDFDoc 7 | .xdp, AcroExch.XDPDoc 8 | .pdx, PDXFileType 9 | .api, AcroExch.Plugin 10 | .secstore, AcroExch.SecStore -------------------------------------------------------------------------------- /Logon/Adobe Acrobat.txt: -------------------------------------------------------------------------------- 1 | # Adobe Acrobat 2 | .pdf, Acrobat.Document.DC 3 | .pdfxml, Acrobat.pdfxml 4 | .acrobatsecuritysettings, Acrobat.acrobatsecuritysettings 5 | .fdf, Acrobat.FDFDoc 6 | .xfdf, Acrobat.XFDFDoc 7 | .xdp, Acrobat.XDPDoc 8 | .pdx, PDXFileType 9 | .api, Acrobat.Plugin 10 | .secstore, Acrobat.SecStore 11 | .sequ, Acrobat.Sequence 12 | .rmf, Acrobat.RMFFile 13 | .bpdx, AcrobatBPDXFileType -------------------------------------------------------------------------------- /IEMode/SitesList.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | EMIESiteListManager 4 | 12.0.0.0 5 | 03/17/2022 22:20:05 6 | 7 | 8 | default 9 | IE11 10 | 11 | 12 | IE8Enterprise 13 | IE11 14 | 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /Citrix/Repair-PublishedDesktopNames/Repair-PublishedDesktopNames.ps1: -------------------------------------------------------------------------------- 1 | #https://support.citrix.com/article/CTX224451 2 | 3 | Add-PSSnapin Citrix.* 4 | $DesktopGroups = @(Get-BrokerDesktopGroup * -MaxRecordCount 999999 | select Name, PublishedName, DeliveryType | Where-Object {(($_.PublishedName -ne $null) -and ($_.DeliveryType -eq "DesktopsOnly"))}) 5 | $Desktops = $DesktopGroups.Name 6 | 7 | ForEach ($Desktop in $Desktops) 8 | { 9 | $NewPublishedName = Read-Host -Prompt "Input your new Published Name for the Delivery Group $Desktop" 10 | Set-BrokerDesktopGroup -Name $Desktop -PublishedName "$NewPublishedName" 11 | Write-Host "The Delivery Group $Desktop published name was renamed to $NewPublishedName" -ForegroundColor Cyan `n 12 | } 13 | Get-BrokerMachine * -MaxRecordCount 999999 | select PublishedName | Where-Object {$_.PublishedName -ne $null} | Set-BrokerMachine -PublishedName $Null -------------------------------------------------------------------------------- /Citrix/Start-FileCaching/README.md: -------------------------------------------------------------------------------- 1 | # Start-FileCaching 2 | 3 | ## About 4 | Start-FileCaching.ps1 is a powershell script to cache dll and exe files for non persistent environment like Citrix PVS/MCS IO. 5 | I took the original script from Citrix consulting and improved it. 6 | 7 | **Start-FileCaching.xml** is a schedule task that will trigger the powershell script Start-FileCaching.ps1 at machine startup. 8 | 9 | ## Supported Powershell Versions 10 | This has been tested with Powershell 5.1. Other versions may work but have not been tested, YMMV. 11 | 12 | ## Installation 13 | * Download the file Start-FileCaching.ps1 and copy it to you're master image in the folder **C:\Scripts**. 14 | * Download the file Start-FileCaching.xml and launch **Task Scheduler**. 15 | * Right-click on the **Task Scheduler Library** and click **Import**. 16 | * Select the file **Start-FileCaching.xml** and press **OK**. 17 | 18 | ## Usage 19 | Cache dll and exe of you're local computer: 20 | ```powershell 21 | .\Start-FileCaching.ps1 22 | ``` -------------------------------------------------------------------------------- /Citrix/Reset-WEMCache/README.md: -------------------------------------------------------------------------------- 1 | # Reset-WEMCache 2 | 3 | ## About 4 | Reset-WEMCache.ps1 is a powershell script to refresh Citrix Workspace Environment Agent cache. 5 | I took the original script from the article [CTX247927](https://support.citrix.com/article/CTX247927) and made it better. 6 | 7 | **Reset-WEMCache.xml** is a schedule task that will trigger the powershell script Reset-WEMCache.ps1 when _**Event ID 0 'Cache sync failed with error: SyncFailed'**_ occurs. 8 | 9 | ## Supported Powershell Versions 10 | This has been tested with Powershell 5.1. Other versions may work but have not been tested, YMMV. 11 | 12 | ## Installation 13 | * Download the file Reset-WEMCache.ps1 and copy it to you're master image in the folder **C:\Scripts**. 14 | * Download the file Reset-WEMCache.xml and launch **Task Scheduler**. 15 | * Right-click on the **Task Scheduler Library** and click **Import**. 16 | * Select the file **Reset-WEMCache.xml** and press **OK**. 17 | 18 | ## Usage 19 | Refresh the Citrix WEM Cache on the local computer: 20 | ```powershell 21 | .\Reset-WEMCache.ps1 22 | ``` 23 | 24 | Refresh the Citrix WEM Cache on remote computer: 25 | ```powershell 26 | Invoke-Command -ComputerName COMPUTER01 -FilePath C:\Scripts\Reset-WEMCache.ps1 27 | ``` -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/tools/chocolateyUninstall.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop'; # stop on all errors 2 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 3 | $osBitness = Get-OSArchitectureWidth 4 | [string]$packageName= $env:ChocolateyPackageName 5 | $version = '8.0.2110.12' 6 | $checkreg64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue 7 | $checkreg32 = Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue 8 | $validExitCodes = @(0,1605,3010) 9 | <# 10 | Exit Codes: 11 | 0: Java installed successfully. 12 | 1605: Java is not installed. 13 | 3010: A reboot is required to finish the install. 14 | #> 15 | 16 | if($checkreg32 -ne $null) 17 | { 18 | Write-Warning "Uninstalling JRE version $version 32bit" 19 | $32 = $checkreg32.PSChildName 20 | Start-ChocolateyProcessAsAdmin "/qn /norestart /X$32" -exeToRun "msiexec.exe" -validExitCodes $validExitCodes 21 | } 22 | if($checkreg64 -ne $null) 23 | { 24 | Write-Warning "Uninstalling JRE version $version $osBitness bit" #Formatted weird for x86 windows installs 25 | $64 = $checkreg64.PSChildName 26 | Start-ChocolateyProcessAsAdmin "/qn /norestart /X$64" -exeToRun "msiexec.exe" -validExitCodes $validExitCodes 27 | } 28 | 29 | Write-Warning "$packageName may require a reboot to complete the uninstallation." -------------------------------------------------------------------------------- /Internet Explorer/Get-InternetExplorer-TPList.ps1: -------------------------------------------------------------------------------- 1 | # Change to your actual domain. And you might want to change the destination =) 2 | # I put it into a scheduled task to run nightly 3 | # Easy list references https://dayngo.com/static/filter.html 4 | # Deployment with Group Policy https://decentsecurity.com/adblocking-for-internet-explorer-deployment 5 | 6 | # Get the current script directory 7 | Function Get-ScriptDirectory { 8 | Remove-Variable appScriptDirectory 9 | Try { 10 | If ($psEditor) { Split-Path $psEditor.GetEditorContext().CurrentFile.Path } # Visual Studio Code Host 11 | ElseIf ($psISE) { Split-Path $psISE.CurrentFile.FullPath } # Windows PowerShell ISE Host 12 | ElseIf ($PSScriptRoot) { $PSScriptRoot } # Windows PowerShell 3.0-5.1 13 | Else { 14 | Write-Host -ForegroundColor Red "Cannot resolve script file's path" 15 | Exit 1 16 | } 17 | } 18 | Catch { 19 | Write-Host -ForegroundColor Red "Caught Exception: $($Error[0].Exception.Message)" 20 | Exit 2 21 | } 22 | } 23 | 24 | # Variables Declaration 25 | # Generic 26 | $ProgressPreference = "SilentlyContinue" 27 | $ErrorActionPreference = "SilentlyContinue" 28 | $env:SEE_MASK_NOZONECHECKS = 1 29 | $appScriptDirectory = Get-ScriptDirectory 30 | #$appScriptDirectory = "\\\NETLOGON\IE_TP" 31 | 32 | Set-Location -Path $appScriptDirectory 33 | 34 | $Url1 = "https://easylist-msie.adblockplus.org/liste_fr+easylist.tpl" 35 | $Output1 = "$appScriptDirectory\{223F8DE5-87F8-4E76-97F1-DAD0A9C8A9A3}.tpl" 36 | 37 | $Url2 = "https://easylist-msie.adblockplus.org/easyprivacy.tpl" 38 | $Output2 = "$appScriptDirectory\{223F8DE5-87F8-4E76-97F1-DAD0A9C8A9A4}.tpl" 39 | 40 | $WebClient = New-Object System.Net.WebClient 41 | $WebClient.DownloadFile($url1, $Output1) 42 | $WebClient.DownloadFile($url2, $Output2) -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/jre8.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jre8 5 | 8.0.211 6 | Java Runtime Environment 7 | Oracle 8 | Oracle 9 | http://www.oracle.com/technetwork/java/javase/terms/license/index.html 10 | http://www.java.com 11 | https://github.com/JonathanPitre/Scripts/Chocolatey-Packages/jre8 12 | http://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/50fd97744110dcbce1acde889c0870599c9d5584/icons/java.svg 13 | false 14 | Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing. Please note you now need a Java License from Oracle to use unless installed for Personal Use and Development Use. 15 | 16 | ### Note 17 | 18 | This package installs the Java version offered at https://www.java.com. It also sets `SPONSORS=0` ([see docs](http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jre-installer-options.html#running)). 19 | 20 | If you wish to only install the 32-bit version of Java use the /exclude parameter. The switch to exclude 32-bit is /exclude:32 and to exclude 64-bit /exclude:64 21 | For example: choco install jre8 -PackageParameters "/exclude:64" -y 22 | This package no longer manually adds an environment variable. 23 | x86 installs of Windows you can expect to see an error while reading the registry, but the script will still function normally. 24 | 25 | This package can install 32-bit, 64-bit, or both versions. Find on [GitHub](https://github.com/JonathanPitre/Scripts/Chocolatey-Packages/jre8) 26 | 27 | java runtime environment 28 | 29 | -------------------------------------------------------------------------------- /Update-PolicyDefinitions/Update-PolicyDefinitions.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 2022-01-04T15:37:24.9367914 6 | Author 7 | \Update Policy Definitions 8 | 9 | 10 | 11 | 2022-01-12T00:00:00 12 | true 13 | 14 | 15 | 2 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | S-1-5-18 40 | Password 41 | HighestAvailable 42 | 43 | 44 | 45 | IgnoreNew 46 | true 47 | true 48 | true 49 | false 50 | false 51 | 52 | true 53 | false 54 | 55 | true 56 | true 57 | false 58 | false 59 | false 60 | PT72H 61 | 7 62 | 63 | 64 | 65 | powershell.exe 66 | -Ex ByPass -File C:\Scripts\Update-PolicyDefinitions.ps1 67 | 68 | 69 | -------------------------------------------------------------------------------- /Get-MicrosoftDefenderUpdates/Get-MicrosoftDefenderUpdates.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 2022-04-06T03:33:12.218773 6 | Author 7 | \Download Microsoft Defender Updates 8 | 9 | 10 | 11 | 2022-04-06T00:00:00 12 | true 13 | 14 | 1 15 | 16 | 17 | 18 | 2022-04-06T12:00:00 19 | true 20 | 21 | 1 22 | 23 | 24 | 25 | 2022-04-06T06:00:00 26 | true 27 | 28 | 1 29 | 30 | 31 | 32 | 2022-04-06T18:00:00 33 | true 34 | 35 | 1 36 | 37 | 38 | 39 | 40 | 41 | S-1-5-18 42 | HighestAvailable 43 | 44 | 45 | 46 | IgnoreNew 47 | true 48 | true 49 | true 50 | false 51 | true 52 | 53 | true 54 | false 55 | 56 | true 57 | true 58 | false 59 | false 60 | false 61 | PT72H 62 | 7 63 | 64 | 65 | 66 | powershell.exe 67 | -Ex ByPass -File C:\Scripts\Get-MicrosoftDefenderUpdates\Get-MicrosoftDefenderUpdates.ps1 68 | 69 | 70 | -------------------------------------------------------------------------------- /StartMenu/Reset-StartMenu.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .FUNCTIONALITY 3 | Resets Win10 start-menu left side and right-side 4 | 5 | .SYNOPSIS 6 | Left-side: Removes orphaned entries that appear randomly and when MS Store (Appx) based apps are cached inside FSLogix profiles, but removed from actual OS 7 | Right-side (tile section): performs resets based on build XML 8 | 9 | .DESCRIPTION 10 | Author owen.reynolds@procontact.ca & jonathan.pitre@procontact.ca 11 | 12 | .EXAMPLE 13 | ./Reset-StartMenu.ps1 14 | 15 | .NOTES 16 | 17 | .Link 18 | N/A 19 | 20 | #> 21 | 22 | Add-Type -AssemblyName System.Windows.Forms 23 | 24 | #Button Legend 25 | # OK 0 26 | # OKCancel 1 27 | # AbortRetryIgnore 2 28 | # YesNoCancel 3 29 | # YesNo 4 30 | # RetryCancel 5 31 | 32 | #Icon legend 33 | # None 0 34 | # Hand 16 35 | # Error 16 36 | # Stop 16 37 | # Question 32 38 | # Exclamation 48 39 | # Warning 48 40 | # Asterisk 64 41 | # Information 64 42 | 43 | 44 | $messageBoxTitle = "Windows Start Menu Reset" 45 | $UserResponse = [System.Windows.Forms.MessageBox]::Show("Do you want to reset the Windows Start Menu to resolve issues with missing/invalid shortcuts?" , $messageBoxTitle, 4, 32) 46 | 47 | If ($UserResponse -eq "YES" ) { 48 | 49 | Write-Host "Reseting windows left / right side Windows 10 icons/allignment" 50 | 51 | Copy-Item -Path "C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml" -Destination "$env:LOCALAPPDATA\Microsoft\Windows\Shell" -Force 52 | Remove-Item 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\*$start.tilegrid$windows.data.curatedtilecollection.tilecollection' -Force -Recurse -ErrorAction SilentlyContinue 53 | 54 | Get-Process shellexperiencehost -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue 55 | 56 | Write-Host "Pausing for for 3 seconds..." 57 | Start-Sleep -Seconds 3 58 | 59 | Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy\TempState\StartUnifiedTileModelCache.dat" -Force -ErrorAction SilentlyContinue 60 | Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\TempState\StartUnifiedTileModelCache.dat" -Force -ErrorAction SilentlyContinue 61 | 62 | Get-Process Explorer | Stop-Process -Force -ErrorAction SilentlyContinue 63 | [System.Windows.Forms.MessageBox]::Show("Windows Start Menu was reset!", $messageBoxTitle, 0, 64) 64 | } 65 | Else { 66 | Write-Host "No" 67 | Exit 68 | } 69 | -------------------------------------------------------------------------------- /Citrix/Start-FileCaching/Start-FileCaching.ps1: -------------------------------------------------------------------------------- 1 | # Get the current script directory 2 | Function Get-ScriptDirectory { 3 | Remove-Variable appScriptDirectory 4 | Try { 5 | If ($psEditor) { Split-Path $psEditor.GetEditorContext().CurrentFile.Path } # Visual Studio Code Host 6 | ElseIf ($psISE) { Split-Path $psISE.CurrentFile.FullPath } # Windows PowerShell ISE Host 7 | ElseIf ($PSScriptRoot) { $PSScriptRoot } # Windows PowerShell 3.0-5.1 8 | Else { 9 | Write-Host -ForegroundColor Red "Cannot resolve script file's path" 10 | Exit 1 11 | } 12 | } 13 | Catch { 14 | Write-Host -ForegroundColor Red "Caught Exception: $($Error[0].Exception.Message)" 15 | Exit 2 16 | } 17 | } 18 | 19 | # Function by Oliver Lipkau (https://devblogs.microsoft.com/scripting/use-powershell-to-work-with-any-ini-file) 20 | Function Get-IniContent ($filePath) { 21 | $ini = @{} 22 | switch -regex -file $FilePath 23 | { 24 | "^\[(.+)\]" # Section 25 | { 26 | $section = $matches[1] 27 | $ini[$section] = @{} 28 | $CommentCount = 0 29 | } 30 | "^(;.*)$" # Comment 31 | { 32 | $value = $matches[1] 33 | $CommentCount = $CommentCount + 1 34 | $name = "Comment" + $CommentCount 35 | $ini[$section][$name] = $value 36 | } 37 | "(.+?)\s*=(.*)" # Key 38 | { 39 | $name,$value = $matches[1..2] 40 | $ini[$section][$name] = $value 41 | } 42 | } 43 | return $ini 44 | } 45 | 46 | # Cache files 47 | Function Start-FileCaching([string]$filename) { 48 | Write-Host $filename 49 | $Bytes = [System.IO.File]::ReadAllBytes($filename) 50 | } 51 | 52 | # Variables Declaration 53 | # Generic 54 | $ProgressPreference = "SilentlyContinue" 55 | $ErrorActionPreference = "SilentlyContinue" 56 | $env:SEE_MASK_NOZONECHECKS = 1 57 | $appScriptDirectory = Get-ScriptDirectory 58 | $Personality = "$env:SystemDrive\Personality.ini" 59 | $filelist = Get-ChildItem "$env:ProgramFiles\*.*", "${env:ProgramFiles(x86)}\*.*" -Recurse 60 | 61 | if ( Test-Path $Personality ) { 62 | $iniContent = Get-IniContent $Personality; 63 | $value = $iniContent["StringData"]; 64 | } 65 | 66 | if ($value.values -eq "Shared") { 67 | $sw = [Diagnostics.Stopwatch]::StartNew() 68 | 69 | foreach ($f in $filelist) { 70 | $ext = [IO.Path]::GetExtension($f) 71 | Switch ($ext) { 72 | {($_ -eq ".dll") -or ($_ -eq ".exe")} {Start-FileCaching($f)} 73 | } 74 | } 75 | 76 | $sw.Stop() 77 | $sw.Elapsed | Out-File -FilePath "$appScriptDirectory\CacheRunTime.log" -Force 78 | } 79 | else { 80 | write-host "The disk is in Private mode!" 81 | exit-pssession 82 | } -------------------------------------------------------------------------------- /Start Layout/StartLayout.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Citrix/Reset-WEMCache/Reset-WEMCache.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 5.1 2 | #Requires -RunAsAdministrator 3 | 4 | <# 5 | .SYNOPSIS 6 | Reset Citrix WEM Agent cache. 7 | 8 | .DESCRIPTION 9 | This script is used to troubleshoot Citrix WEM Agent refresh issues. 10 | 11 | The following command can be used to generate the issue: 12 | Write-EventLog -LogName 'WEM Agent Service' -Source 'WEM Agent Service' -EventId 0 -EntryType Error -Message "Cache sync failed with error: SyncFailed" 13 | 14 | .EXAMPLE 15 | PS> .\Reset-WEMCache.ps1 16 | 17 | .EXAMPLE 18 | PS> Invoke-Command -ComputerName COMPUTER01 -FilePath C:\Scripts\Reset-WEMCache.ps1 19 | 20 | .LINK 21 | https://support.citrix.com/article/CTX247927 22 | 23 | .NOTES 24 | Version: 1.0 25 | Author: Jonathan Pitre 26 | Creation Date: 5/12/2021 27 | Purpose/Change: Initial release 28 | #> 29 | 30 | #---------------------------------------------------------[Initialisations]-------------------------------------------------------- 31 | 32 | $ErrorActionPreference = "SilentlyContinue" 33 | 34 | #----------------------------------------------------------[Declarations]---------------------------------------------------------- 35 | 36 | $LocalDatabaseDir = '${env:CommonProgramFiles(x86)}\Citrix\Workspace Environment Management Agent\Local Databases' 37 | $LocalDatabases = Get-ChildItem -Name "$LocalDatabaseDir\*.db" 38 | $AlternateDatabasesDir = (Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Norskale\Agent Host" -Name "AgentCacheAlternateLocation") 39 | If ($AlternateDatabasesDir) 40 | {$AlternateDatabases = Get-ChildItem -Name $AlternateDatabasesDir\*.db 41 | } 42 | 43 | [string]$Process = (Get-Process -Name VUEMUIAgent | Select-Object -ExpandProperty ProcessName) 44 | $Services = "Netlogon","Citrix WEM Agent Host Service" 45 | 46 | #-----------------------------------------------------------[Execution]------------------------------------------------------------ 47 | 48 | # Stop the VUEMUIAgent.exe process if it is running 49 | if ($Process) 50 | { 51 | Stop-Process -Name $Process -Force 52 | Write-Verbose -Message "VUEMUIAgent has stopped." -Verbose 53 | } else 54 | { 55 | Write-Verbose -Message "VUEMUIAgent is not running." -Verbose 56 | } 57 | 58 | # Stop Citrix WEM Agent Host Service and Netlogon services 59 | foreach ($Service in $Services) 60 | { 61 | Stop-Service -Name $Service -Force 62 | Write-Verbose -Message "$Service has stopped." -Verbose 63 | } 64 | Start-Sleep -Seconds 3 65 | 66 | # Delete the Citrix WEM Agent Cache 67 | If ($LocalDatabases) 68 | { 69 | Remove-Item -Path $LocalDatabasesDir\*.db -Force 70 | Write-Verbose -Message "Local databases have been deleted." -Verbose 71 | } 72 | 73 | If ($AlternateDatabases) 74 | { 75 | Remove-Item -Path $AlternateDatabasesDir\*.db -Force 76 | Write-Verbose -Message "Alternate databases have been deleted." -Verbose 77 | } 78 | Start-Sleep -Seconds 3 79 | 80 | # Start Netlogon Service which will start Citrix WEM Agent Host Service 81 | foreach ($Service in $Services) 82 | { 83 | Start-Service -Name $Service 84 | Write-Verbose -Message "$Service is running." -Verbose 85 | } 86 | Start-Sleep -Seconds 3 87 | 88 | # Refresh Citrix WEM Agent Cache 89 | $WEMAgent = '${env:CommonProgramFiles(x86)}\Citrix\Workspace Environment Management Agent\VUEMUIAgent.exe' 90 | Start-Process -FilePath "${env:CommonProgramFiles(x86)}\Citrix\Workspace Environment Management Agent\AgentCacheUtility.exe" -RefreshCache 91 | Start-Process -FilePath $WEMAgent 92 | Write-Verbose -Message "Citrix WEM cache was reinitialized." -Verbose 93 | 94 | # Write event log 95 | Write-EventLog -LogName 'WEM Agent Service' -Source 'WEM Agent Service' -EventId 0 -EntryType Information -Message 'Successfully reinitialize WEM cache.' -------------------------------------------------------------------------------- /Get-MicrosoftDefenderUpdates/Get-MicrosoftDefenderUpdates.ps1: -------------------------------------------------------------------------------- 1 | # Standalone application install script for VDI environment - (C)2023 Jonathan Pitre 2 | 3 | #---------------------------------------------------------[Initialisations]-------------------------------------------------------- 4 | 5 | $ProgressPreference = "SilentlyContinue" 6 | $ErrorActionPreference = "SilentlyContinue" 7 | # Set the script execution policy for this process 8 | Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force } Catch {} 9 | $env:SEE_MASK_NOZONECHECKS = 1 10 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 11 | [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials 12 | 13 | #-----------------------------------------------------------[Functions]------------------------------------------------------------ 14 | 15 | function Get-MicrosoftDefenderUpdates 16 | { 17 | <# 18 | .SYNOPSIS 19 | Get-MicrosoftDefenderUpdates 20 | .DESCRIPTION 21 | Get-MicrosoftDefenderUpdates downloads the latest Microsoft Defender updates into the specified path. 22 | Create a scheduled task that executes powershell.exe -Ex Bypass \\Get-MicrosoftDefenderUpdates.ps1 23 | .PARAMETER Path 24 | The path to store the Microsof Defender updates 25 | .EXAMPLE 26 | Get-MicrosoftDefenderUpdates -Path C:\MicrosoftDefender 27 | .NOTES 28 | Author: Alex Verboon & Jonathan Pitre 29 | #> 30 | 31 | [CmdletBinding()] 32 | [Alias()] 33 | [OutputType([int])] 34 | Param 35 | ( 36 | # Path where Defender updates are stored 37 | [Parameter(Mandatory = $true, 38 | ValueFromPipelineByPropertyName = $true, 39 | Position = 0)] 40 | $Path 41 | ) 42 | 43 | Begin 44 | { 45 | Write-Host -Object "Downloading latest Microsoft Defender Updates..." -ForegroundColor Green 46 | $vdmpathbase = "$Path\{00000000-0000-0000-0000-" 47 | $vdmpathtime = Get-Date -Format "yMMddHHmmss" 48 | $vdmpath = $vdmpathbase + $vdmpathtime + '}' 49 | $vdmpackage = $vdmpath + '\mpam-fe.exe' 50 | } 51 | Process 52 | { 53 | Try 54 | { 55 | Write-Host -Object "Creating directory $vdmpath..." -ForegroundColor Green 56 | New-Item -ItemType Directory -Force -Path $vdmpath | Out-Null 57 | } 58 | Catch 59 | { 60 | Write-Host -Object "Error creating Microsoft Defender download path $Path!" -ForegroundColor Red 61 | Break 62 | } 63 | 64 | Try 65 | { 66 | Write-Host -Object "Downloading Microsoft Defender update package to $vdmpackage..." -ForegroundColor Green 67 | Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?LinkID=121721&arch=x64' -UseBasicParsing -DisableKeepAlive -OutFile $vdmpackage 68 | } 69 | Catch 70 | { 71 | Write-Host -Object "Error downloading Microsoft Defender updates!" -ForegroundColor Red 72 | } 73 | 74 | Try 75 | { 76 | Write-Host -Object "Extracting $vdmpackage to $vdmpath..." -ForegroundColor Green 77 | Set-Location -Path $vdmpath 78 | .\mpam-fe.exe /x 79 | Get-ChildItem -Path $Path -Filter "mpam-fe.exe" -Recurse | Remove-Item -Force -Recurse 80 | } 81 | Catch 82 | { 83 | Write-Host -Object "Error extracting Microsoft Defender update content!" -ForegroundColor Red 84 | } 85 | 86 | } 87 | End 88 | { 89 | } 90 | } 91 | 92 | #----------------------------------------------------------[Declarations]---------------------------------------------------------- 93 | 94 | $MicrosoftDefenderUpdatesPath = "C:\MicrosoftDefender" 95 | $ShareName = "MicrosoftDefender" 96 | 97 | #-----------------------------------------------------------[Execution]------------------------------------------------------------ 98 | 99 | # Create folder to store Microsoft Defender updates 100 | If (-Not(Test-Path -Path $MicrosoftDefenderUpdatesPath)) 101 | { 102 | Write-Host -Object "Creating $MicrosoftDefenderUpdatesPath folder..." -ForegroundColor Green 103 | New-Item -ItemType Directory -Path $MicrosoftDefenderUpdatesPath -Force | Out-Null 104 | } 105 | Else 106 | { 107 | Write-Host -Object "Folder $MicrosoftDefenderUpdatesPath already exist." -ForegroundColor Yellow 108 | } 109 | 110 | # Create SMB Share 111 | $everyoneSID = [System.Security.Principal.SecurityIdentifier]::new('S-1-1-0') 112 | $everyoneName = $everyoneSID.Translate([System.Security.Principal.NTAccount]).Value 113 | 114 | If (-Not(Get-SmbShare -Name $ShareName)) 115 | { 116 | Write-Host -Object "Creating SMB Share $ShareName..." -ForegroundColor Green 117 | New-SmbShare -Name $ShareName -Path $MicrosoftDefenderUpdatesPath -FullAccess $everyoneName | Out-Null 118 | } 119 | Else 120 | { 121 | Write-Host -Object "SMB Share $ShareName already exist." -ForegroundColor Yellow 122 | } 123 | 124 | # Clean old Microsoft Defender Updates 125 | Write-Host -Object "Cleaning old Microsoft Defender Updates..." -ForegroundColor Green 126 | Get-ChildItem –Path $MicrosoftDefenderUpdatesPath -Recurse | Where-Object { ($_.LastWriteTime -lt (Get-Date).AddDays(-3)) } | Remove-Item -Recurse -Force 127 | 128 | # Download latest Microsoft Defender Updates 129 | Get-MicrosoftDefenderUpdates -Path $MicrosoftDefenderUpdatesPath 130 | 131 | Write-Host -Object "Microsoft Defender Updates were succesfully downloaded!" -ForegroundColor Green -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/tools/config/deployment.properties: -------------------------------------------------------------------------------- 1 | # System Deployment Properties 2 | # Fri Nov 11 2019 3 | # See doc - https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/properties.html 4 | 5 | # General Tab 6 | # Network settings...\Use browser settings 7 | deployment.proxy.type=PROX_TYPE_BROWSER 8 | deployment.proxy.type.locked 9 | 10 | # Security Tab 11 | deployment.webjava.enabled=true 12 | deployment.webjava.enabled.locked 13 | deployment.security.level=HIGH 14 | deployment.security.level.locked 15 | # Exceptions Site List path 16 | deployment.user.security.exception.sites=C\:\\WINDOWS\\Sun\\Java\\Deployment\\exception.sites 17 | deployment.user.security.exception.sites.locked 18 | # Manage Certificates...\System certificates path 19 | deployment.system.security.trusted.certs=C\:\\WINDOWS\\Sun\\Java\\Deployment\\trusted.certs 20 | deployment.system.security.trusted.certs.locked 21 | 22 | # Java Tab 23 | # View...\System Runtime Parameters 24 | # Fix slow performance over HDX/RDP protocol 25 | # https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/java2d-props002.html 26 | deployment.javaws.jre.0.args=-Dsun.java2d.d3d\=false -Dsun.java2d.noddraw\=true 27 | deployment.javaws.jre.1.args=-Dsun.java2d.d3d\=false -Dsun.java2d.noddraw\=true 28 | 29 | # Advanced Tab 30 | # Debugging\Enable tracing 31 | deployment.trace=false 32 | deployment.trace.locked 33 | # Debugging\Enable logging 34 | deployment.log=false 35 | deployment.log.locked 36 | # Debugging\Show applet lifecycle exceptions 37 | deployment.javapi.lifecycle.exception=false 38 | deployment.javapi.lifecycle.exception.locked 39 | # Java console\Hide console 40 | deployment.console.startup.mode=HIDE 41 | deployment.console.startup.mode.locked 42 | # Default Java for browsers\Microsoft Internet Explorer 43 | deployment.browser.vm.iexplorer=true 44 | deployment.browser.vm.iexplorer.locked 45 | # Default Java for browsers\Mozilla family 46 | deployment.browser.vm.mozilla=true 47 | deployment.browser.vm.mozilla.locked 48 | # Shortcut Creation\Never allow 49 | deployment.javaws.shortcut=NEVER 50 | deployment.javaws.shortcut.locked 51 | # JNLP File/MIME Association\Always allow 52 | deployment.javaws.associations=ALWAYS 53 | deployment.javaws.associations.locked 54 | # Application Installation\Install if hinted 55 | deployment.javaws.install=IF_HINT 56 | deployment.javaws.install.locked 57 | # Execution Environment Security Settings\Allow user to grant permissions to signed content 58 | deployment.security.askgrantdialog.show=false 59 | deployment.security.askgrantdialog.show.locked 60 | # Execution Environment Security Settings\Show sandbox warning banner 61 | deployment.security.sandbox.awtwarningwindow=false 62 | deployment.security.sandbox.awtwarningwindow.locked 63 | # Execution Environment Security Settings\Allow user to accept JNLP security requests 64 | deployment.security.sandbox.jnlp.enhanced=true 65 | deployment.security.sandbox.jnlp.enhanced.locked 66 | # Execution Environment Security Settings\Don't prompt for client certificate selection when no certificates or only one exists 67 | deployment.security.clientauth.keystore.auto=true 68 | deployment.security.clientauth.keystore.auto.locked 69 | # Execution Environment Security Settings\Warn if site certificate does not match hostname 70 | deployment.security.jsse.hostmismatch.warning=false 71 | deployment.security.jsse.hostmismatch.warning.locked 72 | # Execution Environment Security Settings\Show site certificate from server even if it is valid 73 | deployment.security.https.warning.show=false 74 | deployment.security.https.warning.show.locked 75 | # (NA in 8u202) Execution Environment Security Settings\Enable granting elevated access to self-signed apps 76 | deployment.security.askgrantdialog.notinca=false 77 | deployment.security.askgrantdialog.notinca.locked 78 | # Mixed code (sandbox vs. trusted) security verification\Enable - hide warning and run with protections 79 | deployment.security.mixcode=HIDE_RUN 80 | deployment.security.mixcode.locked 81 | # Performs signed code certificate revocation checks on\Do not check (not recommended) 82 | deployment.security.revocation.check=NO_CHECK 83 | deployment.security.revocation.check.locked 84 | # Check for TLS certificate revocation using\Both CRLs and OCSP 85 | deployment.security.validation.ocsp=true 86 | deployment.security.validation.ocsp.locked 87 | deployment.security.validation.crl=true 88 | deployment.security.validation.crl.locked 89 | # Performs TLS certificate revocation checks on\Do not check (not recommended) 90 | deployment.security.tls.revocation.check=NO_CHECK 91 | deployment.security.tls.revocation.check.locked 92 | # Check for TLS certificate revocation using\Both CRLs and OCSP 93 | deployment.security.tls.validation.ocsp=true 94 | deployment.security.tls.validation.ocsp.locked 95 | deployment.security.tls.validation.crl=true 96 | deployment.security.tls.validation.crl.locked 97 | # Advanced Security Settings\Enable the operating system's restricted environment (native sandbox) 98 | deployment.security.use.native.sandbox=$LATEST_JRE_HOMEtrue 99 | deployment.security.use.native.sandbox.locked 100 | # Advanced Security Settings\Use certificates and keys in browser keystore 101 | deployment.security.browser.keystore.use=true 102 | deployment.security.browser.keystore.use.locked 103 | # Advanced Security Settings\Enable blacklist revocation check 104 | deployment.security.blacklist.check=true 105 | deployment.security.blacklist.check.locked 106 | # Advanced Security Settings\Enable caching password for authentication 107 | deployment.security.password.cache=true 108 | deployment.security.password.cache.locked 109 | # Advanced Security Settings\Use SSL 2.0 compatible ClientHello format 110 | deployment.security.SSLv2Hello=false 111 | deployment.security.SSLv2Hello.locked 112 | # Advanced Security Settings\Use TLS 1.0 113 | deployment.security.TLSv1=false 114 | deployment.security.TLSv1.locked 115 | # Advanced Security Settings\Use TLS 1.1 116 | deployment.security.TLSv1.1=false 117 | deployment.security.TLSv1.1.locked 118 | # Advanced Security Settings\Use TLS 1.2 119 | deployment.security.TLSv1.2=true 120 | deployment.security.TLSv1.2.locked 121 | # (NA in 8u202) Advanced Security Settings\Enable list of trusted publishers 122 | deployment.security.pretrust.list=true 123 | deployment.security.pretrust.list.locked 124 | # Miscellaneous\Store user settings in roaming profile 125 | deployment.roaming.profile=false 126 | deployment.roaming.profile.locked 127 | # Miscellaneous\Place Java icon in system tray 128 | deployment.system.tray.icon=false 129 | deployment.system.tray.icon.locked 130 | 131 | # Disable Your Java version is insecure or Your Java version is out of date prompts. 132 | # https://becomethesolution.com/your-java-version-is-out-of-date-pop-up-disable 133 | deployment.expiration.check.enabled=false 134 | deployment.expiration.check.enabled.locked 135 | deployment.javaws.autodownload=never 136 | deployment.javaws.autodownload.locked 137 | deployment.expiration.decision=never 138 | deployment.expiration.decision.locked 139 | deployment.expiration.decision.suppression=true 140 | deployment.expiration.decision.suppression.locked 141 | 142 | # Unknown/legacy settings 143 | install.disable.sponsor.offers=false 144 | install.disable.sponsor.offers.locked 145 | deployment.capture.mime.types=true 146 | deployment.capture.mime.types.locked 147 | deployment.security.expired.warning=false 148 | deployment.security.expired.warning.locked 149 | deployment.user.security.trusted.certs.locked 150 | deployment.system.cachedir.locked 151 | deployment.user.cachedir.locked 152 | -------------------------------------------------------------------------------- /VMware/Set-CitrixvSpherePermissions: -------------------------------------------------------------------------------- 1 | # Script to set the required vSphere permissions for Citrix MCS or PVS with an Active Directory Account 2 | # (C)2022 Jean-Marc Pigeon & Jonathan Pitre 3 | 4 | #Requires -Version 5.1 5 | #Requires -RunAsAdministrator 6 | 7 | #---------------------------------------------------------[Initialisations]-------------------------------------------------------- 8 | 9 | $ProgressPreference = "SilentlyContinue" 10 | $ErrorActionPreference = "SilentlyContinue" 11 | # Set the script execution policy for this process 12 | Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Currentuser' -Force } Catch {} 13 | $env:SEE_MASK_NOZONECHECKS = 1 14 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 15 | [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials 16 | $Modules = @("VMware.Powercli", "VIPerms") # Modules list 17 | 18 | Function Get-ScriptDirectory 19 | { 20 | Remove-Variable appScriptDirectory 21 | Try 22 | { 23 | If ($psEditor) { Split-Path $psEditor.GetEditorContext().CurrentFile.Path } # Visual Studio Code Host 24 | ElseIf ($psISE) { Split-Path $psISE.CurrentFile.FullPath } # Windows PowerShell ISE Host 25 | ElseIf ($PSScriptRoot) { $PSScriptRoot } # Windows PowerShell 3.0-5.1 26 | Else 27 | { 28 | Write-Host -Object "Cannot resolve script file's path" -ForegroundColor Red 29 | Exit 1 30 | } 31 | } 32 | Catch 33 | { 34 | Write-Host -Object "Caught Exception: $($Error[0].Exception.Message)" -ForegroundColor Red 35 | Exit 2 36 | } 37 | } 38 | 39 | Function Initialize-Module 40 | { 41 | [CmdletBinding()] 42 | Param 43 | ( 44 | [Parameter(Mandatory = $true)] 45 | [string]$Module 46 | ) 47 | Write-Host -Object "Importing $Module module..." -ForegroundColor Green 48 | 49 | # If module is imported say that and do nothing 50 | If (Get-Module | Where-Object { $_.Name -eq $Module }) 51 | { 52 | Write-Host -Object "Module $Module is already imported." -ForegroundColor Green 53 | } 54 | Else 55 | { 56 | # If module is not imported, but available on disk then import 57 | If (Get-Module -ListAvailable | Where-Object { $_.Name -eq $Module }) 58 | { 59 | $InstalledModuleVersion = (Get-InstalledModule -Name $Module).Version 60 | $ModuleVersion = (Find-Module -Name $Module).Version 61 | $ModulePath = (Get-InstalledModule -Name $Module).InstalledLocation 62 | $ModulePath = (Get-Item -Path $ModulePath).Parent.FullName 63 | If ([version]$ModuleVersion -gt [version]$InstalledModuleVersion) 64 | { 65 | Update-Module -Name $Module -Force 66 | Remove-Item -Path $ModulePath\$InstalledModuleVersion -Force -Recurse 67 | Write-Host -Object "Module $Module was updated." -ForegroundColor Green 68 | } 69 | Import-Module -Name $Module -Force -Global -DisableNameChecking 70 | Write-Host -Object "Module $Module was imported." -ForegroundColor Green 71 | } 72 | Else 73 | { 74 | # Install Nuget 75 | If (-not(Get-PackageProvider -ListAvailable -Name NuGet)) 76 | { 77 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force 78 | Write-Host -Object "Package provider NuGet was installed." -ForegroundColor Green 79 | } 80 | 81 | # Add the Powershell Gallery as trusted repository 82 | If ((Get-PSRepository -Name "PSGallery").InstallationPolicy -eq "Untrusted") 83 | { 84 | Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted 85 | Write-Host -Object "PowerShell Gallery is now a trusted repository." -ForegroundColor Green 86 | } 87 | 88 | # Update PowerShellGet 89 | $InstalledPSGetVersion = (Get-PackageProvider -Name PowerShellGet).Version 90 | $PSGetVersion = [version](Find-PackageProvider -Name PowerShellGet).Version 91 | If ($PSGetVersion -gt $InstalledPSGetVersion) 92 | { 93 | Install-PackageProvider -Name PowerShellGet -Force 94 | Write-Host -Object "PowerShellGet Gallery was updated." -ForegroundColor Green 95 | } 96 | 97 | # If module is not imported, not available on disk, but is in online gallery then install and import 98 | If (Find-Module -Name $Module | Where-Object { $_.Name -eq $Module }) 99 | { 100 | # Install and import module 101 | Install-Module -Name $Module -AllowClobber -Force -Scope AllUsers 102 | Import-Module -Name $Module -Force -Global -DisableNameChecking 103 | Write-Host -Object "Module $Module was installed and imported." -ForegroundColor Green 104 | } 105 | Else 106 | { 107 | # If the module is not imported, not available and not in the online gallery then abort 108 | Write-Host -Object "Module $Module was not imported, not available and not in an online gallery, exiting." -ForegroundColor Red 109 | EXIT 1 110 | } 111 | } 112 | } 113 | } 114 | 115 | # Get the current script directory 116 | $appScriptDirectory = Get-ScriptDirectory 117 | 118 | # Install and import modules list 119 | Foreach ($Module in $Modules) 120 | { 121 | Initialize-Module -Module $Module 122 | } 123 | 124 | #-----------------------------------------------------------[Functions]------------------------------------------------------------ 125 | 126 | 127 | #----------------------------------------------------------[Declarations]---------------------------------------------------------- 128 | 129 | 130 | # https://support.citrix.com/article/CTX214389 131 | # https://ryanjan.uk/2019/06/19/vsphere-global-permissions-with-powershell 132 | # https://jm2k69.github.io/2018/05/PowerCli-roles-and-permissions.html 133 | # https://www.vthistle.com/2015/10/23/vsphere-permissions-powercli 134 | 135 | #-----------------------------------------------------------[Execution]------------------------------------------------------------ 136 | 137 | Write-Host "Veuillez entrer le fqdn de votre VCenter sans le http(s)" -ForegroundColor green 138 | $vcenter = Read-Host 139 | Write-Host "Veuillez entrer le compte administrateur du VCenter" -ForegroundColor green 140 | $cred = Get-Credential 141 | $open = Connect-VIServer -Server $vcenter -credential $cred 142 | if ($open) 143 | { 144 | $Perms = Get-VIPrivilege -id Datastore.AllocateSpace, Datastore.Browse, Datastore.FileManagement, Network.Assign, Resource.AssignVMToPool, VirtualMachine.Config.AddExistingDisk, VirtualMachine.Config.AddNewDisk, VirtualMachine.Config.AdvancedConfig, VirtualMachine.Config.RemoveDisk, VirtualMachine.Interact.PowerOff, VirtualMachine.Interact.PowerOn, VirtualMachine.Inventory.CreateFromExisting, VirtualMachine.Inventory.Create, VirtualMachine.Inventory.Delete, VirtualMachine.Provisioning.Clone, VirtualMachine.State.CreateSnapshot, Global.ManageCustomFields, Global.SetCustomField, VirtualMachine.Config.EditDevice, VirtualMachine.Interact.Reset, VirtualMachine.Interact.Suspend, VirtualMachine.Config.AddRemoveDevice, VirtualMachine.Config.CPUCount, VirtualMachine.Config.Memory, VirtualMachine.Config.Settings, VirtualMachine.Provisioning.CloneTemplate, VirtualMachine.Provisioning.DeployTemplate 145 | Write-Host "Veuillez entrer le nom du role pour Citrix :" -ForegroundColor green 146 | $rolename = Read-Host 147 | Write-Host "Veuillez entrer le compte de service Citrix / VMware (domain\user) :" -ForegroundColor green 148 | Write-Host "Attention Verifier que le compte de service ne soit pas deja utilise" -BackgroundColor red 149 | $domainuserservice = Read-Host 150 | 151 | $role = New-VIRole -Name $rolename -Privilege $Perms 152 | $mypermission = New-VIPermission -Entity (Get-Datacenter) -Principal $domainuserservice -Role $role -Propagate:$true 153 | 154 | if (Connect-VIMobServer -Server $vcenter -credential $cred) 155 | { 156 | #Get-VIGlobalPermission 157 | 158 | Get-VIMobRole | Format-List 159 | Write-Host "Entrer l'ID du role", $rolename, " que vous souhaitez associer" -ForegroundColor red 160 | $roleid = Read-Host -Prompt "roleId" 161 | New-VIGlobalPermission -Name $domainuserservice -roleid $roleid 162 | } 163 | else 164 | { 165 | Write-Host ("impossible de se connecter au vcenter Global Permission") -BackgroundColor red 166 | } 167 | 168 | } 169 | else 170 | { 171 | Write-Host "Verifier les credentials administrator VMware ou le fqdn sans http(s)" -BackgroundColor red 172 | } 173 | -------------------------------------------------------------------------------- /File Associations/Win10_PhotoViewer+Foxit.xml: -------------------------------------------------------------------------------- 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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Chocolatey-Packages/jre8/tools/chocolateyInstall.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop'; # stop on all errors 2 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 3 | $osBitness = Get-OSArchitectureWidth 4 | 5 | try { 6 | 7 | $arguments = @{} 8 | 9 | # Now we can use the $env:chocolateyPackageParameters inside the Chocolatey package 10 | $packageParameters = $env:chocolateyPackageParameters 11 | 12 | # Default value 13 | $exclude = $null 14 | 15 | # Now parse the packageParameters using good old regular expression 16 | if ($packageParameters) { 17 | $match_pattern = "\/(?