Skip to content

Instantly share code, notes, and snippets.

@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.
@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 / 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 / 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 / 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 / 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 / Check-AzureDevOpsLCSServiceConnections.ps1
Last active March 7, 2025 16:07
Check-AzureDevOpsLCSServiceConnections.ps1
# Description: This script checks all the service connections in all the projects in an Azure DevOps
# organization and lists the service connections that are using the deprecated LCS authentication URL.
# Usage: Run the script and enter your Personal Access Token (PAT) and Azure DevOps organization name
# when prompted.
# The PAT requires the following scopes:
# - vso.profile (User Profile - Read)
# - vso.project (Project and Team - Read)
# - vso.serviceendpoint (Service Connections - Read & Query)
# original gist: https://gist.github.com/FH-Inway/5a655609dcd9f90eef4402e02851b488
$token = Read-Host -Prompt "Enter your PAT" -AsSecureString
@FH-Inway
FH-Inway / SyncEngine.log
Created March 5, 2025 15:33
Log of failing SyncEngine.exe run
=== SyncEngine Parameters ===
MetadataBinaries: K:\AosService\PackagesLocalDirectory
BinFolder:
MetadataFolder:
DatabaseConnectionString: **Intentionally omitted for security**
TableOrViewList:
DropTableOrViewList:
SyncMode: FullAll
SecurityRoleList:
SecurityRoleExtensionList:
@FH-Inway
FH-Inway / CHEWindowsUpdateRegistryFix.ps1
Last active March 23, 2025 13:37
Enable Cipher Suites for D365FO Cloud Hosted Environments
# Original Script by @batetech shared with permission.
# This script makes the changes described in https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/troubleshoot-windows-update-error-0x80072efe-with-cipher-suite-configuration
# This will also fix issues where PowerShell modules can no longer be installed.
# See also https://github.com/d365collaborative/d365fo.tools/issues/874
# gist at https://gist.github.com/FH-Inway/193a2819c2682e203496ae7d44baecdb
# Requires -RunAsAdministrator
$ErrorActionPreference = 'Stop';
$regPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002';
$ciphers = Get-ItemPropertyValue "$regPath" -Name 'Functions';
@FH-Inway
FH-Inway / .wrongLineNumber.secrets.baseline
Created November 24, 2024 12:24
detect-secrets: 🐛 scan result has wrong line number, audit seems to use another wrong line number
{
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{