Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
MyITGuy / readme.md
Last active November 26, 2025 14:13

Entry Syntax

00000004 Install-map entry missing component key in populate [l:COMPONENT_NAME_LENGTH]'COMPONENT_NAME' [l:COMPONENT_VERSION_LENGTH]

Meaning

The v!COMPONENT_VERSION key is missing under HKEY_LOCAL_MACHINE\COMPONENTS\DerivedData\VersionedIndex\...\ComponentFamilies\COMPONENT_NAME.

#region Get-SMSAdvertisement
function Get-SMSAdvertisement {
[CmdletBinding()]
PARAM(
[Alias('PKG_PackageID')]
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string]
$PackageId
,
[Alias('PRG_ProgramName')]
function Get-CMSoftwareDistribution {
[CmdletBinding()]
PARAM(
[Alias('PKG_Name')]
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string]
$PackageName
,
[Alias('PKG_PackageID')]
function ConvertFrom-ByteArray {
[CmdletBinding()]
param (
[Alias('appid')]
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[byte[]]
$byteArray
)
begin {}

System File Checker (SFC) Cannot Be Trusted

Known Problem

When executing System File Checker (SFC), aka. sfc.exe, on a computer known to have missing protected files, e.g., \Windows\System32\quser.exe, the computer returns 'Windows Resource Protection did not find any integrity violations.' when it should have returned 'Windows Resource Protection found integrity violations.'

$CommandText = @"
SELECT
[t1].[computer_id]
, [t1].[name]
, [t1].[serial_num]
, [t1].[last_inventory]
, [GS] = (SELECT TOP 1 UPPER([hostname]) FROM mmsettings)
FROM
[computer] [t1]
"@
function Get-WindowsTempExtensionSummary {
[CmdletBinding()]
param (
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string[]]
$ComputerName = $env:COMPUTERNAME
)
begin {
$ScriptBlock = {
$OutputObject = Get-ChildItem -Path $env:windir\temp -Recurse -File | Group-Object -Property Extension | ForEach-Object {
#region Get-CMInstallPath
function Get-CMInstallPath {
function Split-CommandLine {
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)]
[ValidateNotNullOrEmpty()]
[string]$CommandLine
)

Error: Something went wrong. [7q6cd]

Problem

When attempting to authenticate using a Microsoft Entra email address, the following error is presented.

IMPORTANT The Correlation Id does not exist in the tenant for the given User principal name because the request was NOT made to the tenant.

function Invoke-ExtractIcon {
[CmdletBinding(SupportsShouldProcess)]
Param(
[Parameter(Position = 0, Mandatory,HelpMessage = "Specify the path to the file.")]
[ValidateScript({Test-Path $_})]
[string]$Path,
[Parameter(HelpMessage = "Specify the folder to save the file.")]
[ValidateScript({Test-Path $_})]
[string]$Destination = ".",