Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
FH-Inway / Change Yammer page titles.user.js
Last active November 28, 2022 18:06
Tampermonkey script to change Yammer page titles
// ==UserScript==
// @name Change Microsoft Yammer Feedback program page title
// @namespace https://github.com/FH-Inway/tampermonkey
// @version 0.3
// @description Changes titles of Microsoft Yammer Feedback program pages to provide better friendly links in Edge browser
// @author FH-Inway
// @match https://www.yammer.com/dynamicsaxfeedbackprograms/
// @icon https://www.google.com/s2/favicons?sz=64&domain=yammer.com
// @updateURL https://gist.github.com/FH-Inway/74e6cd22c98b8b359fdc715a9f621fea/raw/Change%2520Yammer%2520page%2520titles.user.js
// @downloadURL https://gist.github.com/FH-Inway/74e6cd22c98b8b359fdc715a9f621fea/raw/Change%2520Yammer%2520page%2520titles.user.js
@FH-Inway
FH-Inway / Format-CommentBasedHelp.ps1
Last active June 25, 2023 14:51
d365fo.tools setup + .vscode folder
# Script to format the comments/documentation of the cmdlets used for the commend based help.
# based on https://gist.github.com/Splaxi/ff7485a24f6ed9937f3e8da76b5d4840
# See also https://github.com/d365collaborative/d365fo.tools/wiki/Building-tools
$moduleName = "d365fo.tools"
#$path = "C:\GIT\GITHUB\$moduleName.Workspace\$moduleName\$moduleName"
$path = "C:\Repositories\d365fo.tools\$moduleName"
function Get-Header ($text) {
$start = $text.IndexOf('<#')
$temp = $start - 2
@FH-Inway
FH-Inway / Download-D365FOODataSpecification.ps1
Created July 3, 2023 11:40
Download D365FO OData specification
$MetaDataUrl = 'https://<YourSiteURL>/data/$metadata'
$Outfile = 'C:\Temp\d365fo-odata.edmx'
If (!$Cred){ $Cred = Get-Credential}
Write-Output "Downloading OData specification..."
Invoke-WebRequest -Credential $Cred -Uri $MetaDataUrl -OutFile $Outfile
@FH-Inway
FH-Inway / devcontainer.json
Created July 8, 2023 12:11
Codespaces with PowerShell
{
"image": "mcr.microsoft.com/powershell:latest",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/natescherer/devcontainers-custom-features/powershell-resources": {
"resources": "PSFramework,PoshRSJob"
}
},
"customizations": {
"vscode": {
@FH-Inway
FH-Inway / d365fo-odata-balancecontrol.xml
Created July 13, 2023 14:24
D365FO EDMX trimmed to BalanceControl
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="Microsoft.Dynamics.DataEntities" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="BalanceControl">
<Key>
<PropertyRef Name="dataAreaId" />
<PropertyRef Name="MainAccountId" />
<PropertyRef Name="ChartOfAccounts" />
</Key>
@FH-Inway
FH-Inway / CallSearchScriptForPowerShellModuleCommands.ps1
Last active July 15, 2023 13:01
Search multiple terms in folder
$folderPath = "C:\Repositories\Github\FH-Inway\d365fo.tools"
$moduleName = "AzureAD"
. .\SearchFilesForTerms.ps1
# Import the module with the commands to search for
Import-Module $moduleName
# Get all commands from the module, including aliases
$moduleCommands = Get-Command -Module $moduleName | Select-Object -ExpandProperty Name
@FH-Inway
FH-Inway / d365fo.tools.az.storage.test.codespace.ps1
Created July 15, 2023 17:14
d365fo.tools Az.Storage Test in Codespace
# Replace the following three variables with values for your own azure storage
$azureStorageAccountId = "miscfiles"
$sas = "sv2018-03-28&siunlisted&src&sigAUOpdsfpoWE976ASDhfjkasdf(5678sdfhk"
$container = "backupfiles"
$repositoryModulePath = "/workspaces/d365fo.tools/d365fo.tools"
$fileName = "Test.txt"
# load module
Set-PSFConfig d365fo.tools.Import.IndividualFiles -Value $true
@FH-Inway
FH-Inway / Fix-BacpacModel.ps1
Last active May 8, 2025 06:34
PowerShell script to remove AutoDrop and Grant.KillDatabaseConnection.Database from Bacpac model file
# This script can be used to
# - remove AutoDrop properties
# - remove Grant.KillDatabaseConnection.Database elements of type SqlPermissionStatement
# from the model file of a SQL Server 2022 (or equivalent Azure SQL) bacpac backup.
# This enables restoring the bacpac on a SQL server 2019.
# The d365fo.tools module needs to be installed to run this script.
# See also
# - https://github.com/d365collaborative/d365fo.tools/issues/747 (for AutoDrop)
# - https://github.com/d365collaborative/d365fo.tools/issues/820 (for Grant.KillDatabaseConnection.Database)
# Original script by @batetech in https://www.yammer.com/dynamicsaxfeedbackprograms/#/Threads/show?threadId=2382104258371584
@FH-Inway
FH-Inway / Add-SecurityRoleToUser.ps1
Created November 15, 2023 17:19
d365fo.integrations add role to user
$payload = Get-D365ODataEntityData -EntityName SecurityUserRoles -CrossCompany -Filter "UserId eq 'Guest'" -Verbose
$payload.SecurityRoleIdentifier = 'LedgerAccountant'
$payload.SecurityRoleName = 'Accountant'
$payloadNew = ConvertTo-Json $payload
Import-D365ODataEntity -EntityName SecurityUserRoles -CrossCompany -Payload $payloadNew -Verbose
# Downloads a certificate from an Azure key vault and stores it as .pfx and .cer file in C:\Temp\Certificate
# The files can then be used to enable the Entra integration for a Dynamics 365 Finance and Operations cloud hosted environment.
# See https://github.com/d365collaborative/d365fo.tools/issues/789 for more information
# Original file: https://gist.github.com/FH-Inway/86507ac3ed3e9b2e645ca015b9634f9a
$vaultName = 'MyKeyVaultname'
$certificateName = 'MyCertificateName'
$null = Connect-AzAccount -Tenant 00000000-0000-0000-0000-000000000000 -Subscription 00000000-0000-0000-0000-000000000000