Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
FH-Inway / Get-ParameterValues.ps1
Created March 8, 2025 11:18 — forked from elovelan/Get-ParameterValues.ps1
Rather better than `$PSBoundParameters`
function Get-ParameterValues {
<#
.Synopsis
Get the actual values of parameters which have manually set (non-null) default values or values passed in the call
.Description
Unlike $PSBoundParameters, the hashtable returned from Get-ParameterValues includes non-empty default parameter values.
NOTE: Default values that are the same as the implied values are ignored (e.g.: empty strings, zero numbers, nulls).
.Link
https://gist.github.com/Jaykul/72f30dce2cca55e8cd73e97670db0b09/
.Link
@FH-Inway
FH-Inway / assembly.ps1
Created March 17, 2025 21:11
PSFramework Debug
try {
if ($PSVersionTable.PSVersion.Major -ge 5) {
Add-Type -Path "$script:ModuleRoot\bin\PSFramework.dll" -ErrorAction Stop
}
else {
Add-Type -Path "$script:ModuleRoot\bin\PS4\PSFramework.dll" -ErrorAction Stop
}
}
catch {
Write-Warning "Failed to load PSFramework Assembly! Unable to import module."
@FH-Inway
FH-Inway / Test-SelectPSFObject.ipynb
Last active March 29, 2025 15:32
PSFramework Select-PSFObject First + TypeName Error
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FH-Inway
FH-Inway / Import-D365SecurityDetails.ps1
Created April 8, 2025 16:32
Reassemble files created by Export-D365SecurityDetails.ps1
<#
.SYNOPSIS
Reverses the Export-D365SecurityDetails process by merging XML files back into a base XML structure.
.DESCRIPTION
This script takes a base XML file and merges the contents of XML files from specific folders into the appropriate nodes.
.PARAMETER BaseFilePath
Path to the base XML file.
@FH-Inway
FH-Inway / PerformanceCounterFix.ps1
Last active February 13, 2026 09:24
PerformanceCounterFix.ps1
# This script was originally provided by Microsoft support to resolve the occurrence of the error message
# "The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly."
# It has been made available on the Finance and Operations Viva Engage Community by community members, e.g. here in the Unified Admin and Developer Experiences community:
# https://engage.cloud.microsoft/main/org/microsoft.com/threads/eyJfdHlwZSI6IlRocmVhZCIsImlkIjoiMzU1MjUzOTc3NjQ1MDU2MCJ9?trk_copy_link=V2
# Since attachments in Viva Engage are unreliable, the script is also provided in this gist.
# Original gist: https://gist.github.com/FH-Inway/6d4c902909df93b112ee564b3748e16f
$AOSDirectory = 'J:\AOSService\PackagesLocalDirectory'
$AOSBinDirectory = $AOSDirectory + '\bin'
@FH-Inway
FH-Inway / Using-Microsoft-DataFrame.ipynb
Last active December 6, 2025 12:37
.NET Interactive Polyglot notebook showing regression of Format-Table Powershell command
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.