Skip to content

Instantly share code, notes, and snippets.

View vdepagter's full-sized avatar
🎯
Focusing

Valentijn vdepagter

🎯
Focusing
  • Netherlands
  • 05:53 (UTC +02:00)
View GitHub Profile
@vdepagter
vdepagter / Retrieve-IntelCPUCoreAffinityInfo.ps1
Last active May 24, 2024 19:29
Retrieve Intel CPU Core Counts (P+E) from Intel ARK website and generate affinity masks and decimal values for setting process CPU affinity
# Retrieve-IntelCPUCoreAffinityInfo.ps1, 20240524 VdP
# This script queries Intel ARK website for processor information,
# then uses retrieved Performance & Efficiency Core counts to calculate some common affinity masks and decimal values:
# Only Perf Cores
# Only Perf Cores (without hyperthreading)
# Only Efficiency Cores
# These values can then be used to limit a process to use only particular CPU cores (set CPU affinity)
If (-not (Get-Module -ErrorAction Ignore -ListAvailable PowerHTML)) { Install-Module PowerHTML -Force }
$ProcessorSearchString = (Get-CimInstance -ClassName Win32_Processor | Select -ExpandProperty Name) -Replace ' CPU @.*' -Replace '.* ' #'.* (i[0-9]\-)?'
#$ProcessorSearchString = '12th Gen Intel(R) Core(TM) i7-1255U' -Replace '.* ' #'.* (i[0-9]\-)?'
@vdepagter
vdepagter / Get-MgGraphAllPages.ps1
Created December 29, 2023 11:34
Get-MgGraphAllPages.ps1
# Source: David Richmond, https://dev.to/celadin/get-mggraphallpages-the-mggraph-missing-command-45b5
function Get-MgGraphAllPages {
[CmdletBinding(
ConfirmImpact = 'Medium',
DefaultParameterSetName = 'SearchResult'
)]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'NextLink', ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Alias('@odata.nextLink')]
@vdepagter
vdepagter / Configure-ChromeFlags.ps1
Last active March 10, 2023 14:52
Configure chrome://flags (enabled_labs_experiments) through users' Local State file
# Source: https://gist.github.com/vdepagter/c3a66526467c381bc0b416ca879183c8
# Requires all Chrome processes to be stopped (check persistent task bar).
# Modify $SetProperties as desired. These flags will be added or modified. Existing flags are preserved.
If (Test-Path "I:\Chrome") {
Start-Transcript "I:\Chrome\Set-ChromePrefs.log"
[array]$SetProperties = 'enable-native-notifications@2','enable-system-notifications@2'
try {
If (Test-Path "HKCU:\Software\Policies\Google\Chrome") { $LocalStateFile = (Get-ItemProperty "HKCU:\Software\Policies\Google\Chrome").UserDataDir + '\Local State' }
If (-not $LocalStateFile) { $LocalStateFile = "$($env:localappdata)\Google\Chrome\User Data\Local State" }
#notepad $LocalStateFile