Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
FH-Inway / Get-ADOWorkItemDiscussion.ipynb
Last active August 5, 2024 16:33
Get-ADOWorkItemDiscussion
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 / New-AzureAppRegistrationMSGraph.ps1
Last active August 13, 2024 14:42
New-AzureAppRegistrationMSGraph.ps1
<#
To execute the steps, the id of an Azure application must be provided. The application must have the following API permissions:
- Microsoft Graph (User.Read and Mail.Send permissions of the Application type).
#>
# Based on https://blog.icewolf.ch/archive/2022/12/02/create-azure-ad-app-registration-with-microsoft-graph-powershell
# original gist: https://gist.github.com/FH-Inway/4fc4d4f263900ce1fe240f4d32df23e9
[CmdletBinding()]
$certificateThumbprint = Read-Host -Prompt 'Enter certificate thumbprint'
$applicationId = Read-Host -Prompt 'Enter application id'
$tenantId = Read-Host -Prompt 'Enter tenant id'
Connect-AzAccount -CertificateThumbprint $certificateThumbprint -ApplicationId $applicationId -TenantId $tenantId -Verbose
@FH-Inway
FH-Inway / Invoke-PSMDTemplate.Test.ps1
Last active October 5, 2024 12:15
Test Invoke-PSMDTemplate
Import-Module PSFramework -MaximumVersion 1.11.343
Import-Module PSModuleDevelopment -MaximumVersion 2.2.11.168
Invoke-PSMDTemplate CommandTest -Name Invoke-PSMDTemplate
@FH-Inway
FH-Inway / Create-D365FO.Tools-Cmdlets-As-Draft-Issues.ps1
Last active October 22, 2024 20:29
Draft for some module functions for powershelling the GitHub ProjectV2 GraphQL API
# Example showcasing the use of the GitHub-Project-Manager.ps1
# Iterates over all cmdlets of the d365fo.tools module
# and creates a draft issue for each cmdlet that is missing a draft issue.
Import-Module .\TempPoint\GitHub-Project-Manager.ps1
$project = Get-UserProject -User FH-Inway -ProjectNumber 2
$existingItems = Get-ProjectItems -ProjectId $project.id
# Import-Module d365fo.tools
@FH-Inway
FH-Inway / Get-ConsumedArtifacts.ps1
Last active November 6, 2024 12:14
PowerShell script to get consumed artifacts of an Azure DevOps pipeline run
$token = Read-Host -Prompt "Enter your PAT"
$ORG_NAME = "MyOrg"
$PROJECT_NAME = "MyProject"
$BUILD_ID = "12345"
$tokenEncoded = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$token"))
$url = "https://dev.azure.com/$ORG_NAME/_apis/Contribution/HierarchyQuery/project/$($PROJECT_NAME)?api-version=5.1-preview.0"
$buildResults = @{
@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"
},
{
@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 / 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 / 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