Skip to content

Instantly share code, notes, and snippets.

View StefanMaron's full-sized avatar

Stefan Maroń StefanMaron

View GitHub Profile
@StefanMaron
StefanMaron / DebloatBCCotnainer.ps1
Created June 19, 2023 04:49
uninstall all apps from a BC container except for Base and System App
$keepApps = @("c1335042-3002-4257-bf8a-75c898ccb1b8","437dbf0e-84ff-417a-965d-ed2bb9650972","63ca2fa4-4f03-4f2b-a480-172fef340d3f")
Get-BcContainerAppInfo -containerName $containerName -installedOnly | where -Property AppId -NotIn $keepApps | % {UnInstall-BcContainerApp -containerName $containerName -name $_.Name -publisher $_.Publisher -version $_.Version -Force }
Import-TestToolkitToBcContainer -containerName $containerName -includeTestLibrariesOnly -includePerformanceToolkit
@StefanMaron
StefanMaron / ExtractTestComments.ps1
Last active May 13, 2022 09:33
Extract Test comments to clipbard in order to paste to excel
$rootpath = "<testfolderpath>"
$givenOut = ""
$thenOut = ""
$output = ""
$scenarioName = ""
$files = Get-ChildItem -Path $rootpath
$files | ForEach-Object {
function Git-ClearBranches {
git remote prune origin
git branch -vv | where {$_ -match '\[origin/.*: gone\]'} | foreach {git branch -D ($_.split(" ", [StringSplitOptions]'RemoveEmptyEntries')[0])}
}
@StefanMaron
StefanMaron / CheckCommitContraints.ps1
Created June 10, 2021 14:08
CheckCommitContraints.ps1
$AppJsonFiles = git diff --staged --name-only
$AppJsonFiles | ForEach-Object {
if ($_ -like "*app.json") {
$appJson = git show :$_
$appJson = $appJson | ConvertFrom-Json
$appJsonVersion = [System.Version]$appJson.Version
if ($appJsonVersion.Build -ne 0) {
@StefanMaron
StefanMaron / pre-commit
Created June 10, 2021 14:05
pre-commit
#!C:/Program\ Files/Git/usr/bin/sh.exe
echo
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\.githooks\CheckCommitContraints.ps1"
exit
@StefanMaron
StefanMaron / UpgradeBCDatabaseWithDocker.ps1
Created June 4, 2021 08:52
This is the script I created in this video https://youtu.be/2UnIFAWgEK0
$ContainerNameOld = 'BC17-dev'
$ContainerNameNew = 'BC18-dev'
$TargetVersionBasePath = 'C:\bcartifacts.cache\onprem\18.0.23013.23795'
$BackFolderName = 'C:\ProgramData\BcContainerHelper\DatabaseUpgrade\'
$BackFile17 = Join-Path $BackFolderName 'Database_17.bak'
# Unsinstall all Extensions
Get-BcContainerAppInfo -containerName $ContainerNameOld | ForEach-Object { UnInstall-BcContainerApp -containerName $ContainerNameOld -Name $_.Name -Version $_.Version -Force }
# Unintall all 'Symbols only' extensions
@StefanMaron
StefanMaron / CustomerListExtension.al
Created December 14, 2020 13:52
How to make a column in a List page empty with "SetLoadFields()"
pageextension 50100 CustomerListExt extends "Customer List"
{
actions
{
addlast(processing)
{
action(RunVendorList)
{
ApplicationArea = All;