├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── PSModules ├── CRS.NavContainerHelperExtension │ ├── AppMgt │ │ ├── Clean-NCHCustomNAVApps.ps1 │ │ ├── Convert-NCHTxtToAl.ps1 │ │ ├── Get-NCHCustomNAVApps.ps1 │ │ ├── Install-NCHNavApp.ps1 │ │ └── Upgrade-NCHNAVApp.ps1 │ ├── CRS.NavContainerHelperExtension.psd1 │ ├── CRS.NavContainerHelperExtension.psm1 │ ├── ContainerMgt │ │ ├── New-NCHNAVContainer.ps1 │ │ └── Sync-NCHNAVTenant.ps1 │ ├── Misc │ │ ├── Get-NCHDockerImageName.ps1 │ │ └── Install-NCHDependentModules.ps1 │ ├── NAVObjectMgt │ │ ├── Export-NCHNAVApplicationObjects.ps1 │ │ ├── Export-NCHNAVApplicationObjectsAsAL.ps1 │ │ ├── Merge-NCHNAVApplicationObjects.ps1 │ │ └── Release-NCHNAVApplicationObjects.ps1 │ ├── README.md │ └── Security │ │ └── New-NCHNAVSuperUser.ps1 ├── CRS.RemoteNAVDockerHostHelper │ ├── AppMgt │ │ ├── Clean-RDHCustomNAVApps.ps1 │ │ ├── Convert-RDHTxtToAl.ps1 │ │ ├── Get-RDHCustomNAVApps.ps1 │ │ ├── Install-RDHNAVApp.ps1 │ │ └── Upgrade-RDHNAVApp.ps1 │ ├── CRS.RemoteNAVDockerHostHelper.psd1 │ ├── CRS.RemoteNAVDockerHostHelper.psm1 │ ├── ContainerMgt │ │ ├── Import-RDHNAVContainerLicense.ps1 │ │ ├── Import-RDHTestToolkitToNavContainer.ps1 │ │ ├── New-RDHNAVContainer.ps1 │ │ ├── Remove-RDHNAVContainer.ps1 │ │ └── Sync-RDHNAVTenant.ps1 │ ├── Misc │ │ ├── Copy-FileFromDockerHost.ps1 │ │ ├── Copy-FileToDockerHost.ps1 │ │ ├── Get-RDHHelp.ps1 │ │ └── Install-RDHDependentModules.ps1 │ ├── NAVObjectMgt │ │ ├── Export-RDHNAVApplicationObjects.ps1 │ │ ├── Export-RDHNAVApplicationObjectsAsAL.ps1 │ │ ├── Merge-RDHNAVApplicationObjects.ps1 │ │ └── Release-RDHNAVApplicationObjects.ps1 │ ├── README.md │ └── Security │ │ └── New-RDHNAVSuperUser.ps1 ├── Cloud.Ready.Software.NAV │ ├── Add-NAVEnvironmentCurrentUser.ps1 │ ├── Add-NAVUsersFromAD.ps1 │ ├── Al │ │ ├── Compile-ALApp.ps1 │ │ ├── Download-NAVAppSymbols.ps1 │ │ ├── Get-AlCodeCopInfo.ps1 │ │ ├── Get-AlSymbolFile.ps1 │ │ ├── Get-AppDependencies.ps1 │ │ └── Get-BCAppSymbols.ps1 │ ├── Apps │ │ ├── Create-NAVAppFiles.ps1 │ │ ├── Create-NAVAppPackage.ps1 │ │ ├── Create-NAVXFromDB.ps1 │ │ ├── Deploy-NAVXPackage.ps1 │ │ └── New-NAVAppPermissionSet.ps1 │ ├── Backup-NAVApplicationObjects.ps1 │ ├── Backup-NAVDatabase.ps1 │ ├── Cloud.Ready.Software.NAV.psd1 │ ├── Cloud.Ready.Software.NAV.psm1 │ ├── ConvertTo-NAVMultiTenantEnvironment.ps1 │ ├── Copy-NAVEnvironment.ps1 │ ├── Copy-NAVTenant.ps1 │ ├── Enable-NAVServerInstancePortSharing.ps1 │ ├── Get-NAVApplicationObjectPropertyFromDelta.ps1 │ ├── Get-NAVFinStxHash.ps1 │ ├── Get-NAVModuleVersionSearchJobTask.ps1 │ ├── Get-NAVModuleVersions.ps1 │ ├── Get-NAVObjectFilter.ps1 │ ├── Get-NAVServerConfiguration2.ps1 │ ├── Get-NAVServerInstance2.ps1 │ ├── Get-NAVServerInstance3.ps1 │ ├── Get-NAVServerInstance4.ps1 │ ├── Get-NAVServerInstanceDetails.ps1 │ ├── Import-NAVModules.ps1 │ ├── Installation │ │ ├── Install-NAV.ps1 │ │ ├── Install-NAVFromISO.ps1 │ │ ├── Repair-NAV.ps1 │ │ ├── Repair-NAVFromISO.ps1 │ │ ├── Uninstall-NAV.ps1 │ │ └── Uninstall-NAVFromISO.ps1 │ ├── Management │ │ ├── Get-NAVCompany2.ps1 │ │ └── Get-NAVVersion.ps1 │ ├── ManagementPortal │ │ ├── New-NAVManagedPortalTenant.ps1 │ │ └── New-NAVManagedPortalTenantUser.ps1 │ ├── ModelTools │ │ ├── Add-NAVVersionListMember.ps1 │ │ ├── Apply-NAVDelta.ps1 │ │ ├── Apply-NAVDelta2.ps1 │ │ ├── Compile-NAVApplicationObject2.ps1 │ │ ├── Compile-NAVApplicationObjectInParallel.ps1 │ │ ├── Convert-NAVApplicationObjectLanguageCode.ps1 │ │ ├── Convert-NAVApplicationObjectLanguageKey.ps1 │ │ ├── Copy-NAVChangedMergedResultFiles.ps1 │ │ ├── Create-NAVDelta.ps1 │ │ ├── Delete-NAVApplicationObject2.ps1 │ │ ├── Export-NAVALfromNAVApplicationObject.ps1 │ │ ├── Export-NAVApplicationObject2.ps1 │ │ ├── Export-NAVApplicationObjectDevelopmentLanguage.ps1 │ │ ├── Export-NAVApplicationObjectLanguageHash.ps1 │ │ ├── Export-NAVApplicationObjects_BasedOnObjectfile.ps1 │ │ ├── Export-NAVEventPublishers.ps1 │ │ ├── Fix-NAVTime.ps1 │ │ ├── Get-NAVApplicationObjectDevelopmentLanguage.ps1 │ │ ├── Get-NAVApplicationObjectLanguage.ps1 │ │ ├── Get-NAVApplicationObjectLanguageKeyObject.ps1 │ │ ├── Get-NAVApplicationObjectLanguagePropertyType.ps1 │ │ ├── Get-NAVCodeSnippet.ps1 │ │ ├── Get-NAVDate.ps1 │ │ ├── Get-NAVHighestVersionList.Tests.ps1 │ │ ├── Get-NAVHighestVersionList.ps1 │ │ ├── Import-NAVApplicationObject2.ps1 │ │ ├── Import-NAVApplicationObjectFromString.ps1 │ │ ├── Merge-NAVApplicationObjectProperty.ps1 │ │ ├── Merge-NAVDateTime.ps1 │ │ ├── Merge-NAVUpgradeObjects.ps1 │ │ ├── Merge-NAVVersionList.ps1 │ │ ├── Remove-NAVVersionFromVersionList.ps1 │ │ ├── Remove-NAVVersionListMember.ps1 │ │ └── Switch-NAVDate.ps1 │ ├── NavContainerHelper │ │ └── Clean-CustomNAVAppsOnDocker.ps1 │ ├── New-NAVEnvironment.ps1 │ ├── New-NAVVersionJobManager.ps1 │ ├── Release-NAVVersionList.ps1 │ ├── Remove-NAVEnvironment.ps1 │ ├── SQL │ │ ├── Import-NAVServerLicenseToDatabase.ps1 │ │ └── Invoke-NAVSQL.ps1 │ ├── Select-NAVVersion.ps1 │ ├── Set-NAVUidOffset.ps1 │ ├── Start-NAVApplicationObjectInWebClient.ps1 │ ├── Start-NAVApplicationObjectInWindowsClient.ps1 │ ├── Start-NAVIdeClient.ps1 │ ├── Start-NAVTableInWindowsClient.ps1 │ ├── Start-NAVVersionModuleSearch.ps1 │ ├── Start-NAVWebClient.ps1 │ ├── Start-NAVWindowsClient.ps1 │ ├── Unlock-NAVApplicationObjects.ps1 │ ├── Unzip-NAVCumulativeUpdateDownload.ps1 │ └── Upgrade │ │ ├── Export-NAVCumulativeUpdateApplicationObjects.ps1 │ │ ├── Get-NAVCumulativeUpdateDownloadVersionInfo.ps1 │ │ ├── Get-NAVCumulativeUpdateFile.ps1 │ │ ├── Get-NAVCumulativeUpdateFileName.ps1 │ │ ├── Get-NAVCumulativeUpdateFile_OLD.ps1 │ │ ├── Get-NAVDataUpgradeContinuous.ps1 │ │ ├── Load-NAVCumulativeUpdateHelper.ps1 │ │ ├── New-NAVCumulativeUpdateISOFile.ps1 │ │ ├── New-NAVUpgradeApplicationDB.ps1 │ │ ├── New-NAVUpgradeFobFromMergedText.ps1 │ │ ├── Remove-NAVUpgradeObjectLanguage.ps1 │ │ ├── Start-NAVUpgradeDatabase.ps1 │ │ ├── Start-NAVUpgradeDatabaseMT.ps1 │ │ ├── Unzip-NAVCumulativeUpdateChangedObjects.ps1 │ │ └── Versions.json ├── Cloud.Ready.Software.PowerShell │ ├── Cloud.Ready.Software.PowerShell.psd1 │ ├── Cloud.Ready.Software.PowerShell.psm1 │ ├── Confirm-YesOrNo.ps1 │ └── Get-ObjectFromJSON.ps1 ├── Cloud.Ready.Software.SQL │ ├── Backup-SQLDatabaseToFile.ps1 │ ├── Cloud.Ready.Software.SQL.psd1 │ ├── Cloud.Ready.Software.SQL.psm1 │ ├── Drop-SQLDatabaseIfExists.ps1 │ ├── Get-SQLBackupDatabaseName.ps1 │ ├── Invoke-SQL.ps1 │ ├── Remove-SQLDatabase.ps1 │ └── Restore-SQLBackupFile.ps1 ├── Cloud.Ready.Software.Windows │ ├── Cloud.Ready.Software.Windows.psd1 │ ├── Cloud.Ready.Software.Windows.psm1 │ ├── Create-FolderIfNotExist.ps1 │ ├── Create-ZipFileFromPipedItems.ps1 │ ├── New-ISOFileFromFolder.ps1 │ ├── Remove-InvalidFileNameChars.ps1 │ ├── Unzip-Item.ps1 │ └── Write-IStreamToFile.ps1 ├── CreateProfileInISE.ps1 ├── DownloadAndInstall.ps1 ├── Img │ └── waldo.png ├── InstallModule.ps1 ├── LoadModules.ps1 ├── UnInstallModule.ps1 ├── UpdateModule.ps1 └── UpdateProfile.ps1 ├── PSScripts ├── AppSource │ └── testCode.ps1 ├── Computer Operations │ └── Sleep-Computer.ps1 ├── DevOps │ ├── DeployWithAutomationAPI.ps1 │ ├── DevOps.http │ ├── GetProjects.ps1 │ └── InstallAgent.ps1 ├── File Operations │ ├── Backup Files newer then date.ps1 │ ├── Create ISO Image From Zip │ │ ├── 4. CreateISOImageFromCumulativeUpdate.ps1 │ │ └── 4. CreateISOImageFromZip.ps1 │ └── MoveMoviesFromiPhotoToSelfmadeVideos.ps1 ├── Hetzner │ ├── 1_InstallDocker.ps1 │ ├── BCTechDaysDemo │ │ ├── CreateContianer.ps1 │ │ ├── PrepForBCPT.ps1 │ │ ├── PublishApps.ps1 │ │ ├── Unpublish all waldo-apps.ps1 │ │ ├── _Settings.ps1 │ │ └── apps │ │ │ ├── iFacto Business Solutions NV_iFacto Telemetry_23.2.0.0.app │ │ │ └── waldo_TelemetryPTE_1.0.0.0.app │ ├── Connect-Warp10VSTSAgent.ps1 │ ├── DemoEnv │ │ ├── CreateLIVE.ps1 │ │ ├── CreateQA.ps1 │ │ ├── DeployToQA.ps1 │ │ ├── InstallAppExtDeployer.ps1 │ │ ├── InstallExternalDeployer.ps1 │ │ ├── Untitled13.ps1 │ │ └── Untitled14.ps1 │ ├── Demos │ │ ├── Apps │ │ │ ├── Microsoft_Performance Toolkit Samples.app │ │ │ ├── waldo_BCPerfToolDemos_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext1_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext2_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext3_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext4_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext5_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext6_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext7_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext8_1.0.0.0.app │ │ │ └── waldo_BCPerfTool_1.0.0.0.app │ │ ├── CertificateCreation.ps1 │ │ ├── Create-Container.ps1 │ │ ├── CreateContainer.ps1 │ │ ├── CreateContainerWithBCCH.ps1 │ │ ├── CreateContainers.ps1 │ │ ├── CreateContainersWithBCCH.ps1 │ │ ├── InstallAppExtsOnAllContainers.ps1 │ │ ├── InstallAppsOnAllContainers.ps1 │ │ ├── InstallTraefik.ps1 │ │ ├── InstallTraefikWithBCCH.ps1 │ │ ├── PublishBCPTSamplesToAllContainers.ps1 │ │ ├── RemoveBCContainers.ps1 │ │ ├── UpdateBcContainerHelper.ps1 │ │ └── traefik.yml │ ├── EnableTLS.ps1 │ ├── InstallAgent.ps1 │ ├── InstallDocker.ps1 │ ├── PerformanceTesting │ │ ├── CreateContianer.ps1 │ │ ├── PrepForBCPT.ps1 │ │ ├── Unpublish all waldo-apps.ps1 │ │ └── _Settings.ps1 │ ├── TrainingEnv │ │ ├── Apps │ │ │ ├── Microsoft_Performance Toolkit Samples.app │ │ │ ├── waldo_BCPerfToolDemos_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext1_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext2_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext3_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext4_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext5_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext6_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext7_1.0.0.0.app │ │ │ ├── waldo_BCPerfToolDemos_Ext8_1.0.0.0.app │ │ │ └── waldo_BCPerfTool_1.0.0.0.app │ │ ├── CertificateCreation.ps1 │ │ ├── Create-Container.ps1 │ │ ├── CreateContainer.ps1 │ │ ├── CreateContainers.ps1 │ │ ├── CreateContainersWithBCCH.ps1 │ │ ├── InstallAppExtsOnAllContainers.ps1 │ │ ├── InstallAppsOnAllContainers.ps1 │ │ ├── InstallTraefik.ps1 │ │ ├── InstallTraefikWithBCCH.ps1 │ │ ├── PublishBCPTSamplesToAllContainers.ps1 │ │ ├── RemoveBCContainers.ps1 │ │ ├── UpdateBcContainerHelper.ps1 │ │ └── traefik.yml │ ├── Untitled6.ps1 │ └── install 7zip.ps1 ├── ISE Environment │ ├── Deploy Modules.ps1 │ ├── Modules │ │ ├── Microsoft.Dynamics.Nav.waldo.psd1 │ │ ├── Microsoft.Dynamics.Nav.waldo.psm1 │ │ └── SQL │ │ │ └── Invoke-SQL.ps1 │ └── Setup.ps1 ├── NAV CU Download Automation │ └── DownloadCUAndCreateISO.ps1 ├── NAV Code Analysis │ ├── Export_Publishers.ps1 │ └── LoadModelToolAPI.ps1 ├── NAV Developer Tools │ ├── InstallVSCode.ps1 │ ├── Obsolete │ │ ├── CreateISOandZipOnAzureImage.ps1 │ │ ├── FixScripts │ │ │ ├── 01_BackupDb.ps1 │ │ │ └── 02_FixBrokenEnvironment.ps1 │ │ ├── InstallOnLocalEnvironment.ps1 │ │ └── PrepareAzureVM.ps1 │ └── VSIX │ │ ├── al-0.11.13957.vsix │ │ ├── humao.rest-client-0.16.0.vsix │ │ ├── ms-mssql.mssql-1.2.0.vsix │ │ ├── ms-vscode.PowerShell-1.5.0.vsix │ │ └── waldo.crs-al-language-extension-0.0.8.vsix ├── NAV Docker │ ├── GetAllTagsFromDockerHub.ps1 │ ├── GetAllTagsFromInsiderImages.ps1 │ ├── GetAllTagsFromMSContainerServices.ps1 │ ├── Install Docker │ │ ├── Windows 10 │ │ │ ├── Install-DockerDesktopOnWindows10.ps1 │ │ │ ├── Install-DockerEEOnWindows10.ps1 │ │ │ ├── Install-Portainer.ps1 │ │ │ └── Remove-Docker.ps1 │ │ └── Windows Server │ │ │ ├── 01_InstallDockerEE.ps1 │ │ │ ├── 01_UpdateDocker.ps1 │ │ │ ├── 02_ConfigureDocker.ps1 │ │ │ ├── 03_ConfigureMachine.ps1 │ │ │ ├── 03_SetupNavContainer.ps1 │ │ │ └── 04_SetupDesktop.ps1 │ ├── LocalDocker │ │ ├── PSDev │ │ │ └── CopyScriptsToContainer.ps1 │ │ ├── README.md │ │ ├── Releases │ │ │ ├── 0_CreateReleaseContainer.ps1 │ │ │ ├── 1_Release.ps1 │ │ │ └── _Settings.ps1 │ │ ├── RunTests │ │ │ ├── ImportPSTestTool.ps1 │ │ │ ├── NewContainer.ps1 │ │ │ └── RunTests.ps1 │ │ ├── SetupBCALDep.ps1 │ │ ├── SetupBCCurrent.ps1 │ │ ├── SetupBCDaily.ps1 │ │ ├── SetupBCNext.ps1 │ │ ├── SetupBCOnPrem.ps1 │ │ ├── SetupBCPrivate.ps1 │ │ ├── SetupBCSandbox.ps1 │ │ ├── SetupNavserver.ps1 │ │ ├── SetupNavserver2.ps1 │ │ ├── Upgrades │ │ │ ├── 0_CreateUpgradeContainer.ps1 │ │ │ ├── 1_CopyObjectsToRemoteLibrary.ps1 │ │ │ ├── 2_UpgradeDatabaseWithDocker.ps1 │ │ │ ├── 3_HandleLanguagesAfterUpgrade.ps1 │ │ │ ├── 4_CopyLanguagesToResultFolderForUpdatingGit.ps1 │ │ │ ├── 5_JoinToResultFile.ps1 │ │ │ ├── 6_Release.ps1 │ │ │ ├── README.md │ │ │ └── _Settings.ps1 │ │ ├── _CleanApp.ps1 │ │ ├── _CreateSuperUser.ps1 │ │ ├── _ExportObjectLanguage.ps1 │ │ ├── _ExportObjects.ps1 │ │ ├── _ExportObjectsAsAL.ps1 │ │ ├── _ExportObjects_All.ps1 │ │ ├── _Export_Publishers.ps1 │ │ ├── _ImportTestRunner.ps1 │ │ ├── _InstallApp.ps1 │ │ ├── _PrepDockerHost.ps1 │ │ ├── _RemoveContainer.ps1 │ │ ├── _Settings.ps1 │ │ └── _UpdateApp.ps1 │ ├── LocalDocker2 │ │ ├── CreateImage.ps1 │ │ ├── EnableAppInsights.ps1 │ │ ├── EnumerateAllArtifacts.ps1 │ │ ├── PerfTest │ │ │ ├── RunBCPTTest.ps1 │ │ │ ├── RunBCPTTest2.ps1 │ │ │ └── SetupPerfTestContainer.ps1 │ │ ├── SetupBCCurrent windows.ps1 │ │ ├── SetupBCCurrent.ps1 │ │ ├── SetupBCDEV1.ps1 │ │ ├── SetupBCDEV2.ps1 │ │ ├── SetupBCDaily.ps1 │ │ ├── SetupBCDemos.ps1 │ │ ├── SetupBCDistri.ps1 │ │ ├── SetupBCDxSteel.ps1 │ │ ├── SetupBCNext.ps1 │ │ ├── SetupBCOnPrem.ps1 │ │ ├── SetupBCPublicPreview.ps1 │ │ ├── SetupBCSandbox.ps1 │ │ ├── SetupBCServer.ps1 │ │ ├── SetupBCSpecific.ps1 │ │ ├── SetupBCiFacto.ps1 │ │ ├── _FirstScript.ps1 │ │ ├── _Prep.ps1 │ │ └── _Settings.ps1 │ ├── RemoteDocker │ │ ├── AzureVM │ │ │ ├── CleanApp.ps1 │ │ │ ├── EnterDockerHost.ps1 │ │ │ ├── InstallApp.ps1 │ │ │ ├── SetupDevPreview.ps1 │ │ │ ├── UpgradeApp.ps1 │ │ │ └── _Settings.ps1 │ │ ├── CreateNetworkShare.ps1 │ │ ├── README.md │ │ ├── ReleaseOnWaldoCoreVM │ │ │ ├── 0_SetupPSDevEnv.ps1 │ │ │ ├── 1_Release.ps1 │ │ │ ├── README.md │ │ │ ├── _EnterContainer.ps1 │ │ │ └── _Settings.ps1 │ │ ├── UpgradesOnWaldoCoreVM │ │ │ ├── 0_CreateUpgradeContainer.ps1 │ │ │ ├── 1_CopyObjectsToRemoteLibrary.ps1 │ │ │ ├── 2_UpgradeDatabaseWithDocker.ps1 │ │ │ ├── 3_HandleLanguagesAfterUpgrade.ps1 │ │ │ ├── 4_CopyLanguagesToResultFolderForUpdatingGit.ps1 │ │ │ ├── 5_JoinToResultFile.ps1 │ │ │ ├── 6_Release.ps1 │ │ │ ├── README.md │ │ │ ├── _EnterContainer.ps1 │ │ │ ├── _PrepDockerHost.ps1 │ │ │ └── _Settings.ps1 │ │ ├── WaldosModuleDevHelperScripts │ │ │ ├── EnterDockerHost.ps1 │ │ │ ├── ImportModule.ps1 │ │ │ ├── RemoveModulesFromDockerHost.ps1 │ │ │ ├── SetupPSDevEnv.ps1 │ │ │ ├── Test.ps1 │ │ │ ├── UpdateModulesOnDockerHost.ps1 │ │ │ └── _Settings.ps1 │ │ └── waldocorevm │ │ │ ├── CleanApp.ps1 │ │ │ ├── ConvertApp.ps1 │ │ │ ├── InstallApp.ps1 │ │ │ ├── SetupBCCurrent.ps1 │ │ │ ├── SetupBCDaily.ps1 │ │ │ ├── SetupBCMgt.ps1 │ │ │ ├── SetupBCNext.ps1 │ │ │ ├── SetupBCOnPrem.ps1 │ │ │ ├── SetupD365BE.ps1 │ │ │ ├── SetupNav2018.ps1 │ │ │ ├── UpgradeApp.ps1 │ │ │ ├── _EnterDockerHost.ps1 │ │ │ ├── _ExportObjects.Culture.ps1 │ │ │ ├── _ExportObjects.ps1 │ │ │ ├── _ExportObjectsAsAL.ps1 │ │ │ ├── _ExportObjects_All.ps1 │ │ │ ├── _Export_Publishers.ps1 │ │ │ ├── _ImportDataPackage.ps1 │ │ │ ├── _ImportLicense.ps1 │ │ │ ├── _InstallTestCodeunits.ps1 │ │ │ ├── _PrepDockerHost.ps1 │ │ │ ├── _RebuildSearch.ps1 │ │ │ ├── _Settings.ps1 │ │ │ ├── _StartDockerHostVM.ps1 │ │ │ └── _UpgradeNavApp.ps1 │ └── UpdateBcContainerHelper.ps1 ├── NAV Events │ └── GetEventsFromSource.ps1 ├── NAV Extensions v2 │ ├── CodeAnalysesInfo.ps1 │ ├── Convert-PermissionSets.psm1 │ ├── DeploymentExternalDeployer │ │ └── DeployAppsWithExternalDeployer.ps1 │ ├── DisableFeature.ps1 │ ├── DownloadSymbols.ps1 │ ├── ExecuteObjects.ps1 │ ├── ExportTestApp │ │ └── Export-TestApp.ps1 │ ├── GetBCArtifactSourceCode.ps1 │ ├── GetDependencies.ps1 │ ├── GetDependencies_TestApps.ps1 │ ├── IsSymbolOnly.ps1 │ ├── MultiRootWorkspaces │ │ ├── Apps_AppSourcePrevious_PrepAll.ps1 │ │ ├── Apps_App_Cleanup.ps1 │ │ ├── Apps_CompileAll.ps1 │ │ ├── Apps_LaunchJson_CopyToAll.ps1 │ │ ├── Apps_NewRepo.ps1 │ │ ├── Apps_OpenAppJsons.ps1 │ │ ├── Apps_Symbol_Cleanup.ps1 │ │ ├── Apps_Symbol_Download.ps1 │ │ ├── Apps_UpdateReleasedApps.ps1 │ │ ├── Apps_UpdateTranslationFiles.ps1 │ │ ├── Apps_ZipTranslation.ps1 │ │ ├── Git_CreateBranchFromMaster.ps1 │ │ ├── Git_DeleteBranch.ps1 │ │ ├── Git_DiscardAll.ps1 │ │ ├── Git_PruneOrigin.ps1 │ │ ├── Git_StageAndCommit.ps1 │ │ ├── Git_SwitchBranch.ps1 │ │ ├── Git_SyncMasterBranch.ps1 │ │ ├── Git_UpdateBranchFromMaster.ps1 │ │ ├── _Settings.ps1 │ │ └── _SettingsCustomers.ps1 │ ├── Permissions │ │ └── GetNewObjectsFromCodeHistory.ps1 │ ├── Removeextension.ps1 │ ├── RenumberAL.ps1 │ ├── Txt2Al - navcontainerhelper │ │ ├── Step 1.ps1 │ │ ├── Step 2.ps1 │ │ ├── Step 3.ps1 │ │ ├── Step 4.ps1 │ │ ├── Step 5.ps1 │ │ ├── Step 6.ps1 │ │ ├── _EnterContainer.ps1 │ │ └── _Settings.ps1 │ ├── Txt2Al │ │ ├── Step 1.ps1 │ │ ├── Step 2.ps1 │ │ ├── Step 3.ps1 │ │ ├── Step 4.ps1 │ │ ├── Step 5.ps1 │ │ ├── Step 6.ps1 │ │ ├── _EnterContainer.ps1 │ │ └── _Settings.ps1 │ ├── UpdateMSDyn365bc.Code.History.ps1 │ └── ValidateAppsourceApps.ps1 ├── NAV Extensions │ ├── 1_CreateDEVEnvironment.ps1 │ ├── 2_ApplyDeltasInDEV.ps1 │ ├── 3_CreatePermissionSets.ps1 │ ├── 3_CreateWebServices.ps1 │ ├── 3_CreateWebServices_WithCodeunit.ps1 │ ├── 4_OpenDEVEnvironment.ps1 │ ├── 5_BuildAndDeployApp.ps1 │ ├── 6_BackupApp.ps1 │ ├── OLD │ │ ├── BuildNAVApp.ps1 │ │ └── HelloWorldOnCustomerList.txt │ ├── OLD2 │ │ ├── Backup DEV Objects.ps1 │ │ ├── Build NAV Extensions and Deploy.ps1 │ │ ├── Create DEV Environment.ps1 │ │ ├── Remove DEV Environment.ps1 │ │ ├── Reset Test Environment.ps1 │ │ └── Set-NAVExtensionSettings.ps1 │ ├── README.md │ └── _Settings.ps1 ├── NAV Installation │ ├── 2015 │ │ ├── FixRegistryAfterInstallNAV2016withNAV2015.ps1 │ │ └── FullInstallNAV2015.xml │ ├── 2016 │ │ ├── FullInstallNAV2016.xml │ │ └── FullInstallNAV2016_ReplaceDB.xml │ ├── 2017 │ │ ├── FullInstallNAV2017.ps1 │ │ └── FullInstallNAV2017_ReplaceDB.xml │ ├── 2018 │ │ ├── FullInstallNAV2018.ps1 │ │ └── FullInstallNAV2018.xml │ ├── Create Default NAV Environment in TFS from a download from partner source │ │ ├── Execute.ps1 │ │ ├── FullInstallNAV2016.xml │ │ └── InstallConfig.xml │ ├── Install VM with ISO.ps1 │ ├── InstallNAVFromDVD.ps1 │ ├── InstallNAVFromISO.ps1 │ ├── License Upload │ │ └── Import-License To All ServerInstances.ps1 │ └── VM - testing testing.ps1 ├── NAV Languages │ ├── CompareObjectFilesAndRemoveIdentical.ps1 │ ├── CopyLanguage │ │ ├── CopyLanguage.ps1 │ │ ├── ENU.txt │ │ ├── NLB.txt │ │ └── Result.txt │ ├── CreateLanguageENUFromFieldnames │ │ ├── CreateLanguageENUFromFieldnames.ps1 │ │ └── Objects.txt │ ├── Export Languages with missing languages │ │ ├── ExportLanguagesIncludingMissingLanguages.ps1 │ │ ├── ExportedTranslation.txt │ │ └── NoLanguages.txt │ ├── ExportAllEncodings.ps1 │ ├── TestBasics.ps1 │ ├── TestCreatingDictionary.ps1 │ ├── TestLanguages_Advanced.ps1 │ ├── TestLanguages_Functions.ps1 │ └── TranslateModule.ps1 ├── NAV Objects │ ├── ApplyDeltasToServiceInstance.ps1 │ ├── ApplyDeltasToServiceInstance_Reverse.ps1 │ ├── Fix_Date.ps1 │ ├── Fix_Versionlist.ps1 │ └── Test.ps1 ├── NAV Product Release │ ├── Release-Product.ps1 │ ├── TEST.ps1 │ └── UpdateVersionListWithOriginalIfIdenticalObject.ps1 ├── NAV Security │ └── ChangeServiceUser.ps1 ├── NAV Test Toolset │ ├── Import Application Test Toolset.ps1 │ ├── ImportAllTestCodeunits.fob │ └── Log │ │ └── navcommandresult.txt ├── NAV Upgrades │ ├── CU │ │ ├── CU_UpgradeDatabase.ps1 │ │ ├── InstallCU.ps1 │ │ ├── SendMail.ps1 │ │ ├── Set-UpgradeSettings.ps1 │ │ └── Set-UpgradeSettings_TestCustomer.ps1 │ ├── Conflicts │ │ ├── AnalyzeConflicts.ps1 │ │ └── RemoveAllButModifiedConflicts.ps1 │ ├── CreateNewOriginalFromTwoVersions.ps1 │ ├── DownloadCU │ │ ├── Test Download CU with KB URL.ps1 │ │ ├── Test_DownloadCU.ps1 │ │ └── Test_NAVCumulativeUpdateHelper.ps1 │ ├── HandleLanguagesAfterUpgrade.ps1 │ ├── InitEnvironment.ps1 │ ├── Merge samples │ │ ├── ImportObjectsInDatabase.ps1 │ │ ├── MAIN Merge Script.ps1 │ │ └── MAIN Script (Gunther).ps1 │ ├── README.md │ ├── RemoveEnvironments.ps1 │ ├── Set-UpgradeSettings.ps1 │ ├── UpgradeDatabase.ps1 │ ├── UpgradeDatabase_MT.ps1 │ └── VersionList │ │ └── Test Merge Versionlist.ps1 ├── Remote PowerShell │ ├── ClientSide.ps1 │ └── ServerSide.ps1 └── _Samples │ ├── CompileNAVObjects.ps1 │ ├── Download Files │ └── DownloadFilesFromDirectionsEmea.ps1 │ ├── Workshop Examples │ ├── Add-NAVEnvironment.ps1 │ └── PermissionStaat.ps1 │ └── _ReOrder _WaldoPhoneBackup.ps1 └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "workbench.colorCustomizations": { 3 | "titleBar.activeBackground": "#061b9e", 4 | "activityBar.background": "#061b9e", 5 | "titleBar.activeForeground": "#ffffff", 6 | "activityBar.foreground": "#ffffff" 7 | }, 8 | "powershell.codeFormatting.addWhitespaceAroundPipe": true 9 | } -------------------------------------------------------------------------------- /PSModules/CRS.NavContainerHelperExtension/AppMgt/Get-NCHCustomNAVApps.ps1: -------------------------------------------------------------------------------- 1 | function Get-NCHCustomNAVApps { 2 | <# 3 | .SYNOPSIS 4 | Gets all non-Microsoft Apps from a Container 5 | 6 | .PARAMETER ContainerName 7 | The Container 8 | 9 | .EXAMPLE 10 | Get-NCHCustomNAVApps ` 11 | -ContainerName $Containername 12 | #> 13 | param( 14 | [Parameter(Mandatory = $true)] 15 | [String] $ContainerName 16 | ) 17 | 18 | Write-Host -ForegroundColor Green "$($MyInvocation.MyCommand.Name) on $env:COMPUTERNAME" 19 | 20 | # $Session = Get-NavContainerSession -containerName $ContainerName 21 | # Invoke-Command -Session $Session -ScriptBlock { 22 | Invoke-ScriptInNavContainer -ContainerName $ContainerName -scriptblock { 23 | 24 | Return Get-NAVAppInfo -ServerInstance NAV | Where Publisher -ne 'Microsoft' 25 | } 26 | } -------------------------------------------------------------------------------- /PSModules/CRS.NavContainerHelperExtension/CRS.NavContainerHelperExtension.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/CRS.NavContainerHelperExtension/ContainerMgt/Sync-NCHNAVTenant.ps1: -------------------------------------------------------------------------------- 1 | function Sync-NCHNAVTenant { 2 | <# 3 | .SYNOPSIS 4 | Execute Sync-NAVTenant on a container. 5 | 6 | .PARAMETER ContainerName 7 | The container you want to run this function on 8 | 9 | .NOTES 10 | Executes a Sync-NAVTenant -ServerInstance NAV -Force on the container. 11 | #> 12 | 13 | param( 14 | [Parameter(Mandatory = $true)] 15 | [String] $ContainerName 16 | ) 17 | 18 | Write-Host -ForegroundColor Green "$($MyInvocation.MyCommand.Name) on $env:COMPUTERNAME" 19 | 20 | # $Session = Get-NavContainerSession -containerName $ContainerName 21 | # Invoke-Command -Session $Session -ScriptBlock { 22 | Invoke-ScriptInNavContainer -containerName $ContainerName -scriptblock { 23 | Sync-NAVTenant -ServerInstance NAV -Force 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /PSModules/CRS.NavContainerHelperExtension/README.md: -------------------------------------------------------------------------------- 1 | # CRS.DockerHostHelper 2 | This module acts as an extension to the navcontainerhelper. 3 | Just to be able to add more functionality with dependencies to my own modules "Cloud.Ready.Software.*" that might be installed within 4 | 5 | This also means the module is higly dependent on the 'navcontainerhelper' module by Freddy Kristiansen. 6 | 7 | ## Rule of engagement 8 | - All functions get its own file 9 | - No files in the root folder 10 | - Name should be like Powershell CmdLets: Verb-Noun 11 | - All Nouns should start with "CRS" 12 | -------------------------------------------------------------------------------- /PSModules/CRS.RemoteNAVDockerHostHelper/CRS.RemoteNAVDockerHostHelper.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/CRS.RemoteNAVDockerHostHelper/Misc/Get-RDHHelp.ps1: -------------------------------------------------------------------------------- 1 | function Get-RDHHelp { 2 | <# 3 | .SYNOPSIS 4 | Gets help from this module 5 | 6 | .PARAMETER Examples 7 | Show examples 8 | 9 | .PARAMETER Passthru 10 | Return the "help" object to be able to tranfrom or manipulate the object yourself 11 | #> 12 | param( 13 | [Switch] $Examples, 14 | [Switch] $Passthru 15 | ) 16 | 17 | if ($Passthru){ 18 | get-command -module crs.RemoteNAVDockerhostHelper | Get-Help -Examples:$Examples 19 | } else { 20 | get-command -module crs.RemoteNAVDockerhostHelper | Sort-Object Noun | Get-Help | select Name, Synopsis, examples | ForEach-Object { 21 | Write-Host -ForegroundColor Green -Object "$($_.Name)" 22 | if ($Examples){ 23 | Get-Help $_.Name -Examples 24 | } else { 25 | Write-Host -ForegroundColor Gray " $($_.Synopsis)" 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Apps/Create-NAVAppPackage.ps1: -------------------------------------------------------------------------------- 1 | function Create-NAVAppPackage 2 | { 3 | [CmdLetBinding()] 4 | param([Parameter(Mandatory=$true)] [string] $AppName, 5 | [Parameter(Mandatory=$true)] [string] $BuildFolder, 6 | [Parameter(Mandatory=$true)] [string] $Publisher, 7 | [Parameter(Mandatory=$true)] [string] $Description, 8 | [string] $Version = '1.0.0.0', 9 | [string] $ApplicationID = '') 10 | 11 | if ($ApplicationID -eq '') 12 | { 13 | $ApplicationID = [guid]::NewGuid() 14 | } 15 | 16 | $navAppManifestFile = $BuildFolder + $AppName + '.xml' 17 | 18 | $MyNewManifest = New-NAVAppManifest -Name $AppName -Publisher $Publisher -Description $Description -Id $ApplicationID -Version $Version -ErrorAction Stop #-Capabilities 0,1,2 19 | 20 | Write-Host -Foregroundcolor Green "Manifest created: $MyNewManifest" 21 | 22 | return $MyNewManifest 23 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Cloud.Ready.Software.NAV.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Enable-NAVServerInstancePortSharing.ps1: -------------------------------------------------------------------------------- 1 | function Enable-NAVServerInstancePortSharing 2 | { 3 | [CmdletBinding()] 4 | param 5 | ( 6 | [Parameter(Mandatory=$true, ValueFromPipelineByPropertyname=$true)] 7 | [System.String] 8 | $ServerInstance 9 | ) 10 | process { 11 | $ServiceName = (get-navserverinstance -ServerInstance $ServerInstance).ServerInstance 12 | if (!($ServiceName)){ 13 | Write-Error "$Serverinstance not found as an NAV ServerInstance." 14 | return $null 15 | } 16 | 17 | write-Host -ForegroundColor Green "Enabling PortSharing for $ServerInstance" 18 | Set-NAVServerInstance -ServerInstance $ServerInstance -Stop -ErrorAction SilentlyContinue 19 | 20 | $null = sc.exe config (get-service NetTcpPortSharing).Name Start= Auto 21 | $null = Start-service NetTcpPortSharing 22 | 23 | $Service = get-service $ServiceName 24 | $null = sc.exe config $Service.Name depend= HTTP/NetTcpPortSharing 25 | 26 | Set-NAVServerInstance -ServerInstance $ServerInstance -Start 27 | } 28 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Get-NAVFinStxHash.ps1: -------------------------------------------------------------------------------- 1 | Function Get-NAVFinStxHash{ 2 | if (!$NAVIde){ 3 | $finstx = (Get-ChildItem "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV" -Recurse | where Name -like fin.stx).FullName 4 | if (!$finstx){ 5 | write-error 'Module "Microsoft.Dynamics.Nav.Model.Tools" has not been loaded. Please load this module.' 6 | break 7 | } 8 | } else { 9 | $finstx = $NavIde -replace 'finsql.exe', 'fin.stx' 10 | } 11 | 12 | $finstxLines = @() 13 | get-content $finstx | foreach{ 14 | $Regex = '(\d+-\d+)-.+: (.+)' 15 | $MatchedRegEx = [regex]::Match($_, $Regex) 16 | 17 | if ($MatchedRegEx.Success){ 18 | $finstxlines += @{$MatchedRegEx.Groups[1].Value = $MatchedRegEx.Groups[2].Value} 19 | } 20 | } 21 | 22 | return $finstxLines 23 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Get-NAVModuleVersionSearchJobTask.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVModuleVersionSearchJobTask { 2 | <# 3 | .SYNOPSIS 4 | 5 | .DESCRIPTION 6 | 7 | .EXAMPLE 8 | 9 | #> 10 | 11 | [CmdletBinding()] 12 | param ( 13 | 14 | [parameter(Mandatory=$true)] 15 | [String]$navModuleName, 16 | 17 | [parameter(Mandatory=$true)] 18 | [String]$navModuleDllName, 19 | 20 | [parameter(Mandatory=$false)] 21 | [String]$navModuleTitle 22 | 23 | ) 24 | 25 | if ([string]::IsNullOrEmpty($navModuleTitle)) { 26 | $navModuleTitle = $navModuleName 27 | } 28 | 29 | $task = New-Object PSObject 30 | 31 | $task | Add-Member NoteProperty NavModuleName -Value $navModuleName 32 | $task | Add-Member NoteProperty NavModuleDllName -Value $navModuleDllName 33 | $task | Add-Member NoteProperty NavModuleTitle -Value $navModuleTitle 34 | 35 | $task | Add-Member NoteProperty ScriptBlock -Value { param($navModuleName, $navModuleDllName, $navModuleTitle) Get-NAVModuleVersions $navModuleName $navModuleDllName $navModuleTitle } 36 | 37 | return $task 38 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Get-NAVObjectFilter.ps1: -------------------------------------------------------------------------------- 1 | #included functions 2 | function Get-NAVObjectFilter 3 | { 4 | [CmdletBinding()] 5 | param ( 6 | [parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] 7 | [String]$ObjectType, 8 | [parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] 9 | [Object]$ObjectCollection 10 | 11 | ) 12 | BEGIN 13 | { 14 | } 15 | PROCESS 16 | { 17 | $Filter = '' 18 | $ObjectCollection | Where-Object ObjectType -eq $ObjectType | foreach {$Filter = $Filter + "|" + $_.Id} 19 | $Filter = $Filter.Trim("|") 20 | Write-Host "$ObjectType : $Filter" 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Get-NAVServerConfiguration2.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVServerConfiguration2 2 | { 3 | [CmdletBinding()] 4 | param ( 5 | [parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] 6 | [String]$ServerInstance 7 | ) 8 | BEGIN 9 | { 10 | $ResultObjectArray = @() 11 | 12 | } 13 | PROCESS 14 | { 15 | $CurrentServerInstance = Get-NAVServerInstance -ServerInstance $ServerInstance 16 | $CurrentConfig = $CurrentServerInstance | Get-NAVServerConfiguration -AsXml 17 | 18 | foreach ($Setting in $CurrentConfig.configuration.appSettings.add) 19 | { 20 | $ResultObject = New-Object System.Object 21 | $ResultObject | Add-Member -type NoteProperty -name ServiceInstance -value $CurrentServerInstance.ServerInstance 22 | $ResultObject | Add-Member -type NoteProperty -name Key -value $Setting.Key 23 | $ResultObject | Add-Member -Type NoteProperty -Name Value -Value $Setting.Value 24 | $ResultObjectArray += $ResultObject 25 | } 26 | 27 | } 28 | END 29 | { 30 | $ResultObjectArray 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Get-NAVServerInstance3.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVServerInstance3 2 | { 3 | [CmdletBinding()] 4 | param 5 | ( 6 | [Parameter(Mandatory=$false, Position=0)] 7 | [System.String] 8 | $ServerInstance 9 | ) 10 | 11 | process { 12 | $ServerInstanceObjects = Get-NAVServerInstance -ServerInstance $ServerInstance 13 | 14 | foreach ($ServerInstanceObject in $ServerInstanceObjects) { 15 | $ServerConfigKeys = Get-NAVServerConfiguration2 -ServerInstance $ServerInstanceObject.ServerInstance 16 | 17 | foreach($ServerConfigKey in $ServerConfigKeys) { 18 | $PropertyAlreadyExists = $ServerInstanceObject | Get-Member | Where Name -ieq $ServerConfigKey.Key 19 | if (-not ($PropertyAlreadyExists)){ 20 | $ServerInstanceObject | Add-member -MemberType NoteProperty -Name $ServerConfigKey.Key -Value $ServerConfigKey.Value 21 | } 22 | } 23 | 24 | $ServerInstanceObject 25 | } 26 | 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Installation/Repair-NAV.ps1: -------------------------------------------------------------------------------- 1 | function Repair-NAV 2 | { 3 | [CmdletBinding()] 4 | Param 5 | ( 6 | [Parameter(Mandatory=$true)] 7 | [String] $DVDFolder, 8 | [Parameter(Mandatory=$true)] 9 | [String] $Log 10 | 11 | ) 12 | process 13 | { 14 | write-host -foregroundcolor green -object 'Repairing NAV Installation ...' 15 | write-host -foregroundcolor green -object '' 16 | write-host -foregroundcolor green -object 'please be patient ...' 17 | 18 | if ($DVDFolder.Length -eq 3){ 19 | $SetupPath = "$($DVDFolder)setup.exe" 20 | } else { 21 | $SetupPath = Join-Path $DVDFolder 'setup.exe' 22 | } 23 | Start-Process $SetupPath -ArgumentList '/repair','/quiet',"/Log ""$($Log)""" -PassThru | Wait-Process 24 | 25 | Write-Host 'Log output:' -ForegroundColor Green 26 | Get-Content $Log | foreach { 27 | Write-Host " $_" -ForegroundColor Gray 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Installation/Repair-NAVFromISO.ps1: -------------------------------------------------------------------------------- 1 | function Repair-NAVFromISO 2 | { 3 | [CmdletBinding()] 4 | Param 5 | ( 6 | [Parameter(Mandatory=$true, Position=0)] 7 | [System.String] 8 | $ISOFilePath, 9 | 10 | [Parameter(Mandatory=$true, Position=2)] 11 | [System.String] 12 | $Log 13 | 14 | ) 15 | process 16 | { 17 | 18 | $null = Mount-DiskImage -ImagePath $ISOFilePath 19 | $iSOImage = Get-DiskImage -ImagePath $ISOFilePath | Get-Volume 20 | $DVDFolder = "$($IsoImage.DriveLetter):\" 21 | write-host "Mounted ISO to $($IsoImage.DriveLetter)-Drive" -ForegroundColor Green 22 | 23 | Repair-NAV -DVDFolder $DVDFolder -Log $Log 24 | 25 | $null = Dismount-DiskImage -ImagePath $ISOFilePath 26 | write-host "Dismounted $($IsoImage.DriveLetter)-Drive" -ForegroundColor Green 27 | 28 | 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Installation/Uninstall-NAV.ps1: -------------------------------------------------------------------------------- 1 | function UnInstall-NAV 2 | { 3 | [CmdletBinding()] 4 | Param 5 | ( 6 | [String] $DVDFolder, 7 | [String] $Log 8 | ) 9 | process 10 | { 11 | #Install 12 | write-host 'Uninstalling NAV...' -ForegroundColor Green 13 | 14 | if ($DVDFolder.Length -eq 3){ 15 | $SetupPath = "$($DVDFolder)setup.exe" 16 | } else { 17 | $SetupPath = Join-Path $DVDFolder 'setup.exe' 18 | } 19 | Start-Process $SetupPath -ArgumentList '/uninstall', '/quiet',"/Log ""$($Log)""" -PassThru| Wait-Process 20 | 21 | Write-Host 'Log output:' -ForegroundColor Green 22 | Get-Content $Log | foreach { 23 | Write-Host " $_" -ForegroundColor Gray 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Installation/Uninstall-NAVFromISO.ps1: -------------------------------------------------------------------------------- 1 | function UnInstall-NAVFromISO 2 | { 3 | <# 4 | .SYNOPSIS 5 | Installs NAV from an ISO file 6 | #> 7 | [CmdletBinding()] 8 | param 9 | ( 10 | [Parameter(Mandatory=$true, Position=0)] 11 | [System.String] 12 | $ISOFilePath, 13 | [Parameter(Mandatory=$true, Position=0)] 14 | [System.String] 15 | $Log 16 | ) 17 | Mount-DiskImage -ImagePath $ISOFilePath 18 | $iSOImage = Get-DiskImage -ImagePath $ISOFilePath | Get-Volume 19 | $DVDFolder = "$($IsoImage.DriveLetter):\" 20 | write-host "Mounted ISO to $($IsoImage.DriveLetter)-Drive" -ForegroundColor Green 21 | 22 | UnInstall-NAV -DVDFolder $DVDFolder -Log $Log 23 | 24 | Dismount-DiskImage -ImagePath $ISOFilePath 25 | write-host "Dismounted $($IsoImage.DriveLetter)-Drive" -ForegroundColor Green 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Management/Get-NAVCompany2.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVCompany2 2 | { 3 | [CmdletBinding()] 4 | param ( 5 | [parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] 6 | [String]$ServerInstance, 7 | [parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true)] 8 | [String]$Id="Default" 9 | ) 10 | PROCESS 11 | { 12 | $CurrentTenant = Get-NAVTenant -ServerInstance $ServerInstance -Tenant $Id 13 | $AllCompaniesInTenant = $CurrentTenant | Get-NAVCompany 14 | 15 | foreach ($Company in $AllCompaniesInTenant) 16 | { 17 | $Company | Add-Member -type NoteProperty -name ServerInstance -value $CurrentTenant.ServerInstance 18 | $Company | Add-Member -type NoteProperty -name Tenant -value $CurrentTenant.Id 19 | 20 | $Company 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Management/Get-NAVVersion.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVVersion { 2 | $file = Get-ChildItem -Path c:\ -Recurse -Filter 'Microsoft.Dynamics.NAV*.dll' | select -First 1 3 | if(!$file){ 4 | Write-Error 'NAV not found on this system!' 5 | } else { 6 | [System.Diagnostics.FileVersionInfo]::GetVersionInfo($file.FullName).FileVersion 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Add-NAVVersionListMember.ps1: -------------------------------------------------------------------------------- 1 | function Add-NAVVersionListMember { 2 | param ( 3 | [Parameter(Mandatory=$true)] 4 | [String]$VersionList, 5 | [Parameter(Mandatory=$true)] 6 | [String]$AddVersionList 7 | ) 8 | 9 | if ([String]::IsNullOrEmpty($VersionList)) { 10 | return $AddVersionList 11 | break 12 | } 13 | 14 | if ([String]::IsNullOrEmpty($AddVersionList)) { 15 | return $VersionList 16 | break 17 | } 18 | 19 | return "$($VersionList),$AddVersionList" 20 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Convert-NAVApplicationObjectLanguageKey.ps1: -------------------------------------------------------------------------------- 1 | function Convert-NAVApplicationObjectLanguageKey { 2 | param( 3 | [String] $KeyToConvert, 4 | [String] $ToLanguage 5 | ) 6 | 7 | $KeyObject = Get-NAVApplicationObjectLanguageKeyObject -Key $KeyToConvert 8 | 9 | $CurrentLanguage = $KeyObject.LCID 10 | $KeyToConvert -replace "-A$($CurrentLanguage)-", "-A$(Convert-NAVApplicationObjectLanguageCode -Convert $ToLanguage)-" 11 | } 12 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Export-NAVApplicationObjectDevelopmentLanguage.ps1: -------------------------------------------------------------------------------- 1 | function Export-NAVApplicationObjectDevelopmentLanguage{ 2 | param( 3 | [String] $Source, 4 | [String] $DestinationXML, 5 | [String] $DevelopmentLanguageId, 6 | [String] $WorkingFolder 7 | ) 8 | 9 | $DevLanguage = 10 | Export-NAVApplicationObjectLanguage ` 11 | -Source $Source ` 12 | -LanguageId $DevelopmentLanguageId ` 13 | -Destination (Join-Path $workingfolder "DEVLanguage.txt") ` 14 | -Force ` -PassThru ` -DevelopmentLanguageId $DevelopmentLanguageId 15 | 16 | $Dictionary = @() 17 | $i = 0 18 | $count = ($DevLanguage.TranslateLines | measure).Count 19 | foreach ($Entry in $DevLanguage.TranslateLines){ 20 | $i++ 21 | write-progress -Activity 'Building Dictionary' -Status "$($i)/$($count)" -PercentComplete (($i / $count)*100) 22 | 23 | $DictEntry = @{$Entry.Key=$Entry.Value} 24 | $Dictionary += $DictEntry 25 | } 26 | 27 | if ($DestinationXML) { 28 | $null = $Dictionary | Export-Clixml -Path $DestinationXML 29 | } 30 | 31 | return $Dictionary 32 | } 33 | 34 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Fix-NAVTime.ps1: -------------------------------------------------------------------------------- 1 | Function Fix-NAVTime { 2 | param( 3 | [String] $TimeString 4 | ) 5 | 6 | $Result = $TimeString 7 | 8 | if ($TimeString.Length -eq 11) { 9 | $Result = $TimeString[0..7] -join '' 10 | } 11 | 12 | return $Result 13 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Get-NAVApplicationObjectDevelopmentLanguage.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVApplicationObjectDevelopmentLanguage{ 2 | param( 3 | [String] $SourceXML 4 | ) 5 | 6 | $Dictionary = Import-Clixml $SourceXML 7 | 8 | return $Dictionary 9 | } 10 | 11 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Get-NAVApplicationObjectLanguagePropertyType.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVApplicationObjectLanguagePropertyType { 2 | [CmdLetBinding()] 3 | param( 4 | [Parameter(Mandatory=$True, ValueFromPipeline=$True)] 5 | [String] $Key, 6 | [Parameter(Mandatory=$True)] 7 | [Object] $FinStxHash 8 | ) 9 | process{ 10 | $RegEx = 'P(\d+)' 11 | $MatchedRegEx = [regex]::Matches($Key,$Regex) 12 | foreach($Match in $MatchedRegEx){ 13 | $Property = $Match.Groups[1].Value 14 | 15 | $HexToken = [Convert]::ToString($Property, 16) 16 | $StringToken1 = ([convert]::ToString([Convert]::ToInt32($HexToken.Substring(0,$HexToken.Length-2),16))).PadLeft(5,'0') 17 | $StringToken2 = ([convert]::ToString([Convert]::ToInt32($HexToken.Substring($HexToken.Length-2,2),16))).PadLeft(5,'0') 18 | $StringToken = "$($StringToken1)-$($StringToken2)" 19 | 20 | $FinStxHash.$stringToken 21 | } 22 | 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Get-NAVDate.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVDate { 2 | param( 3 | [String] $DateStringFromNAVObjectFile, 4 | [String] $Format 5 | ) 6 | 7 | try { Get-date $DateStringFromNAVObjectFile -Format $Format} 8 | catch { Get-date (Switch-NAVDate -DateString $DateString) -Format $Format} 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Remove-NAVVersionFromVersionList.ps1: -------------------------------------------------------------------------------- 1 | function Remove-NAVVersionFromVersionList { 2 | <# 3 | .SYNOPSIS 4 | Removes a part of the Version List 5 | .DESCRIPTION 6 | Removes a part of the Version List 7 | .EXAMPLE 8 | To remove the prefixes 'I' and 'M' from VersionList 'NAVW17.0,NAVBE7.0,NAVWD7.1,I8.0,M20156' 9 | Remove-NAVVersionFromVersionList -VersionList 'NAVW17.0,NAVBE7.0,NAVWD7.1,I8.0,M20156' -RemovePrefixes 'I','M' 10 | Result: 11 | NAVW17.0,NAVBE7.0,NAVWD7.1 12 | .PARAMETER VersionList 13 | The VersionList that needs to be modified 14 | .PARAMETER RemovePrefixes 15 | The prefixes that need to disappear from the VersionList 16 | #> 17 | param( 18 | [String] $VersionList, 19 | [String[]] $RemovePrefixes 20 | ) 21 | $Versions = $VersionList.Split(',') 22 | foreach($RemovePrefix in $RemovePrefixes){ 23 | $Versions = $Versions | where {-not($_.StartsWith($RemovePrefix))} 24 | } 25 | 26 | $NewVersionList = $Versions -join ',' 27 | $NewVersionList 28 | } 29 | 30 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Remove-NAVVersionListMember.ps1: -------------------------------------------------------------------------------- 1 | function Remove-NAVVersionListMember { 2 | param ( 3 | [Parameter(Mandatory=$true)] 4 | [String]$VersionList, 5 | [Parameter(Mandatory=$true)] 6 | [String]$RemoveVersionList 7 | ) 8 | 9 | $allVersions = @() + $VersionList.Split(',') 10 | 11 | $NewVersionList = @() 12 | 13 | $allVersions = @() + $Versionlist.Split(',') 14 | $allVersions | foreach { 15 | if ($_ -ine $RemoveVersionList){ 16 | $NewVersionList += $_ 17 | } 18 | } 19 | 20 | return $NewVersionList -join ',' 21 | 22 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/ModelTools/Switch-NAVDate.ps1: -------------------------------------------------------------------------------- 1 | function Switch-NAVDate{ 2 | param( 3 | [String] $DateString 4 | ) 5 | 6 | $DateArray = $DateString -split '' 7 | $NewDate = ($DateArray[4..5]+ '/' + $DateArray[1..2] + '/' + $DateArray[7..8]) -join '' 8 | 9 | return $NewDate 10 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Set-NAVUidOffset.ps1: -------------------------------------------------------------------------------- 1 | function Set-NAVUidOffset { 2 | <# 3 | .Synopsis 4 | Set the UidOffSet of a certain database from a certain instance 5 | .DESCRIPTION 6 | The UIDOffSet is important to control the "controlids" of the controls you create during development. With this 7 | .NOTES 8 | 9 | .PREREQUISITES 10 | 11 | .EXAMPLE 12 | 13 | #> 14 | 15 | param 16 | ( 17 | [Parameter(ValueFromPipelineByPropertyName=$true,Mandatory=$true)] 18 | [Object] $ServerInstance, 19 | [parameter(Mandatory=$true)] 20 | [int] $UidOffSet 21 | ) 22 | 23 | $SQLCommand = "UPDATE [$('$ndo$dbproperty')] SET [uidoffset] = $UidOffSet" 24 | 25 | Invoke-NAVSQL ` -ServerInstance $ServerInstance ` 26 | -SQLCommand $SQLCommand 27 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVApplicationObjectInWebClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVApplicationObjectInWebClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [Parameter(Mandatory=$true)] 6 | [String]$WebServerInstance, 7 | [ValidateSet('Web','Tablet','Phone')] 8 | [String]$WebClientType='Web', 9 | [Parameter(Mandatory=$true)] 10 | [ValidateSet('Page','Report')] 11 | [String]$ObjectType, 12 | [Parameter(Mandatory=$true)] 13 | [int]$ObjectID 14 | ) 15 | 16 | $WebClientUri = (Get-NAVWebServerInstance -WebServerInstance $WebServerInstance).uri -split ',' | select -First 1 17 | 18 | switch ($WebClientType) 19 | { 20 | 'Web' {$WebClientUri += '/default.aspx'} 21 | 'Tablet' {$WebClientUri += '/tablet.aspx'} 22 | 'Phone' {$WebClientUri += '/phone.aspx'} 23 | } 24 | 25 | switch($ObjectType) 26 | { 27 | 'Page' {$WebClientUri += "?Page=$ObjectID"} 28 | 'Report' {$WebClientUri += "?Report=$ObjectID"} 29 | } 30 | 31 | Write-Host -ForegroundColor Green -Object "Starting: $WebClientUri" 32 | Start-Process -FilePath $WebClientUri 33 | } 34 | 35 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVApplicationObjectInWindowsClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVApplicationObjectInWindowsClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [string]$ServerName=[net.dns]::Gethostname(), 6 | [int]$Port=7046, 7 | [String]$ServerInstance, 8 | [String]$Companyname, 9 | [string]$Tenant='default', 10 | [ValidateSet('Table','Page','Report','Codeunit','Query','XMLPort')] 11 | [String]$ObjectType, 12 | [int]$ObjectID 13 | ) 14 | 15 | $ConnectionString = "DynamicsNAV://$Servername" + ":$Port/$ServerInstance/$Companyname/Run$ObjectType"+"?$ObjectType=$ObjectID&tenant=$tenant" 16 | Write-Verbose "Connectionstring: $ConnectionString ..." 17 | Start-Process $ConnectionString 18 | } 19 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVIdeClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVIdeClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [String]$ServerInstance, 6 | [string]$ServerName=([net.dns]::GetHostName()), 7 | [String]$Database 8 | ) 9 | 10 | if ([string]::IsNullOrEmpty($NavIde)) { 11 | Write-Error 'Please load the AMU (NavModelTools) to be able to use this function' 12 | } 13 | 14 | if (-not $Database){ 15 | $ServerinstanceDetails = Get-NAVServerInstanceDetails -ServerInstance $ServerInstance -ErrorAction SilentlyContinue 16 | if ($ServerinstanceDetails){ 17 | $ServerName = $ServerinstanceDetails.DatabaseServer 18 | IF (-not ([String]::IsNullOrEmpty($ServerinstanceDetails.DatabaseInstance))){ 19 | $ServerName = "$($ServerName)\$($ServerinstanceDetails.DatabaseInstance)" 20 | } 21 | $Database = $ServerinstanceDetails.DatabaseName 22 | } 23 | } 24 | 25 | $Arguments = "servername=$ServerName, database=$Database, ntauthentication=yes" 26 | Write-Host -ForegroundColor Green "Starting the DEV client with Arguments: $Arguments ..." 27 | Start-Process -FilePath $NavIde -ArgumentList $Arguments 28 | } 29 | 30 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVTableInWindowsClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVTableInWindowsClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [string]$ServerName, 6 | [int]$Port=7046, 7 | [String]$ServerInstance, 8 | [String]$Companyname, 9 | [string]$tenant='default', 10 | [String]$TableID 11 | ) 12 | 13 | if ([string]::IsNullOrEmpty($Companyname)) { 14 | $Companyname = (Get-NAVCompany -ServerInstance $ServerInstance -Tenant $tenant)[0].CompanyName 15 | } 16 | 17 | $ConnectionString = "DynamicsNAV://$Servername" + ":$Port/$ServerInstance/$Companyname/RunTable?Table=$TableID&tenant=$tenant" 18 | Write-Verbose "Starting $ConnectionString ..." 19 | Start-Process $ConnectionString 20 | } 21 | 22 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVWebClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVWebClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [Parameter(Mandatory=$true)] 6 | [String]$WebServerInstance, 7 | [ValidateSet('Web','Tablet','Phone')] 8 | [String]$WebClientType='Web' 9 | ) 10 | 11 | $WebClientUri = (Get-NAVWebServerInstance -WebServerInstance $WebServerInstance).uri 12 | 13 | switch ($WebClientType) 14 | { 15 | 'Web' {$WebClientUri += '/default.aspx'} 16 | 'Tablet' {$WebClientUri += '/tablet.aspx'} 17 | 'Phone' {$WebClientUri += '/phone.aspx'} 18 | } 19 | 20 | Start-Process -FilePath $WebClientUri 21 | } 22 | 23 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Start-NAVWindowsClient.ps1: -------------------------------------------------------------------------------- 1 | function Start-NAVWindowsClient 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [Parameter(Mandatory=$true)] 6 | [String]$ServerInstance, 7 | [string]$ServerName=([net.dns]::gethostname()), 8 | [int]$Port=7046, 9 | [String]$Companyname, 10 | [string]$tenant='default' 11 | ) 12 | 13 | $ServerinstanceDetails = Get-NAVServerInstanceDetails -ServerInstance $ServerInstance -ErrorAction SilentlyContinue 14 | if ($ServerinstanceDetails){ 15 | $Port = $ServerinstanceDetails.ClientServicesPort 16 | if ([string]::IsNullOrEmpty($Companyname)) { $Companyname = (Get-NAVCompany -ServerInstance $ServerInstance -Tenant $tenant| select -First 1).CompanyName 17 | } 18 | } 19 | $WinClient = (Join-path (Get-Item $NavIde).Directory 'Microsoft.Dynamics.Nav.Client.exe') 20 | $ConnectionString = """DynamicsNAV://$($Servername):$($Port)/$($ServerInstance)/$($Companyname)/?tenant=$($tenant)""" 21 | Write-host -ForegroundColor green -object "Starting $WinClient $ConnectionString ..." 22 | Start-Process -FilePath $WinClient -ArgumentList $ConnectionString 23 | } 24 | 25 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Unlock-NAVApplicationObjects.ps1: -------------------------------------------------------------------------------- 1 | function Unlock-NAVApplicationObjects 2 | { 3 | param( 4 | [String] $ServerInstance 5 | ) 6 | 7 | $ServerInstanceObject = Get-NAVServerInstanceDetails -ServerInstance $ServerInstance 8 | 9 | $DatabaseServer = $ServerInstanceObject.DatabaseServer 10 | if (!([string]::IsNullOrEmpty($ServerInstanceObject.DatabaseInstance))){ 11 | $DatabaseServer += "\$($ServerInstanceObject.DatabaseInstance)" 12 | } 13 | 14 | Invoke-SQL ` 15 | -DatabaseServer $DatabaseServer ` 16 | -DatabaseName $ServerInstanceObject.DatabaseName ` 17 | -SQLCommand "UPDATE [$($ServerInstanceObject.DatabaseName)].[dbo].[Object] SET [Locked]=0,[Locked By]=''" 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Upgrade/Export-NAVCumulativeUpdateApplicationObjects.ps1: -------------------------------------------------------------------------------- 1 | function Export-NAVCumulativeUpdateApplicationObjects { 2 | [CmdletBinding()] 3 | Param 4 | ( 5 | [Parameter(Mandatory=$true)] 6 | [Object] $CUObjectFile, 7 | [Parameter(Mandatory=$true)] 8 | [String] $ServerInstance, 9 | [Parameter(Mandatory=$true)] 10 | [String] $Workingfolder 11 | 12 | ) 13 | 14 | #Replaced by Export-NAVApplicationObjects_SameAsObjectfile 15 | Export-NAVApplicationObjects_BasedOnObjectfile ` 16 | -ObjectFile $CUObjectFile ` -ServerInstance $ServerInstance ` -ResultFolder $Workingfolder 17 | 18 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.NAV/Upgrade/Get-NAVCumulativeUpdateFileName.ps1: -------------------------------------------------------------------------------- 1 | function Get-NAVCumulativeUpdateFileName 2 | { 3 | [CmdletBinding()] 4 | Param 5 | ( 6 | [Parameter(Mandatory=$true)] 7 | [String] $FullPathToZip, 8 | [Parameter(Mandatory=$false)] 9 | [String] $Subfolder='', 10 | [Parameter(Mandatory=$true)] 11 | [String] $Filter 12 | ) 13 | 14 | $SourcePathZip = [io.path]::ChangeExtension($FullPathToZip,'zip') 15 | Rename-Item $FullPathToZip $SourcePathZip 16 | 17 | try { 18 | $SourcePath = join-path $SourcePathZip $Subfolder 19 | 20 | $helper = New-Object -ComObject Shell.Application 21 | $files = $helper.NameSpace($SourcePath).Items() 22 | $filename = ($files | where path -like $Filter).name 23 | 24 | } finally { 25 | if ($FullPathToZip -ne $SourcePathZip) { 26 | Rename-Item $SourcePathZip $FullPathToZip 27 | } 28 | } 29 | 30 | 31 | 32 | return $filename 33 | } 34 | 35 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.PowerShell/Cloud.Ready.Software.PowerShell.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' -File | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.PowerShell/Confirm-YesOrNo.ps1: -------------------------------------------------------------------------------- 1 | #Source: http://www.peetersonline.nl/2009/07/user-confirmation-in-powershell/ 2 | 3 | Function Confirm-YesOrNo 4 | { 5 | param( 6 | [string]$title="Confirm", 7 | [string]$message="Are you sure?" 8 | ) 9 | 10 | $choiceYes = New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'Answer Yes.' 11 | $choiceNo = New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Answer No.' 12 | $options = [System.Management.Automation.Host.ChoiceDescription[]]($choiceYes, $choiceNo) 13 | $result = $host.ui.PromptForChoice($title, $message, $options, 1) 14 | 15 | switch ($result) 16 | { 17 | 0 18 | { 19 | Return $true 20 | } 21 | 22 | 1 23 | { 24 | Return $false 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.PowerShell/Get-ObjectFromJSON.ps1: -------------------------------------------------------------------------------- 1 | function Get-ObjectFromJSON { 2 | param( 3 | [String] $Path 4 | ) 5 | 6 | Write-Verbose "Function: Get-SCMObjectFromJSON" 7 | $Object = (Get-Content $Path) -Join "`n" | ConvertFrom-Json 8 | 9 | return $Object 10 | } 11 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.SQL/Cloud.Ready.Software.SQL.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' -File | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.SQL/Drop-SQLDatabaseIfExists.ps1: -------------------------------------------------------------------------------- 1 | function Drop-SQLDatabaseIfExists { 2 | param ([String]$SQLServer="(local)", $Databasename) 3 | 4 | [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null 5 | [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null 6 | [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null 7 | [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null 8 | 9 | $smoserver = New-Object ( "Microsoft.SqlServer.Management.Smo.Server" ) $SQLServer 10 | 11 | if ($smoserver.Databases[$Databasename]) { 12 | $smoserver.KillAllProcesses($Databasename) 13 | $smoserver.Databases[$Databasename].drop() 14 | } 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.SQL/Get-SQLBackupDatabaseName.ps1: -------------------------------------------------------------------------------- 1 | function Get-SQLBackupDatabaseName 2 | { 3 | [cmdletbinding()] 4 | param( 5 | [String] $Backupfile 6 | ) 7 | 8 | import-module 'sqlps' -DisableNameChecking 9 | 10 | $null = get-item $Backupfile -ErrorAction Stop 11 | 12 | $srv = new-object ('Microsoft.SqlServer.Management.Smo.Server') ([net.dns]::GetHostName()) 13 | $rs = new-object('Microsoft.SqlServer.Management.Smo.Restore') 14 | $bdi = new-object ('Microsoft.SqlServer.Management.Smo.BackupDeviceItem') ($Backupfile, 'File') 15 | $rs.Devices.Add($bdi) 16 | 17 | return $rs.ReadBackupHeader($srv).Databasename 18 | } 19 | 20 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/Cloud.Ready.Software.Windows.psm1: -------------------------------------------------------------------------------- 1 | Get-Item $PSScriptRoot | Get-ChildItem -Recurse -Filter '*.ps1' -File | where FullName -NotLike '*Tests.ps1' | Sort Name | foreach { 2 | Write-Verbose "Loading $($_.Name)" 3 | . $_.fullname 4 | } 5 | 6 | Export-ModuleMember -Function * -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/Create-FolderIfNotExist.ps1: -------------------------------------------------------------------------------- 1 | function Create-FolderIfNotExist 2 | { 3 | [CmdletBinding()] 4 | param ( 5 | [String]$MyFolder 6 | ) 7 | 8 | if ( -Not (Test-Path $MyFolder)) 9 | { 10 | New-Item $MyFolder -type directory 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/Create-ZipFileFromPipedItems.ps1: -------------------------------------------------------------------------------- 1 | #still some work to do - doesn't work that well .. 2 | #source: http://www.technologytoolbox.com/blog/jjameson/archive/2012/02/28/zip-a-folder-using-powershell.aspx 3 | 4 | function Create-ZipFileFromPipedItems 5 | { 6 | param([string]$zipfilename) 7 | 8 | if(test-path($zipfilename)) 9 | { 10 | get-item $zipfilename | remove-item 11 | } 12 | 13 | set-content $zipfilename ('PK' + [char]5 + [char]6 + ("$([char]0)" * 18)) 14 | (get-childitem $zipfilename).IsReadOnly = $false 15 | 16 | $shellApplication = new-object -com shell.application 17 | $zipPackage = $shellApplication.NameSpace($zipfilename) 18 | 19 | foreach($file in $input) 20 | { 21 | $zipPackage.CopyHere($file.FullName) 22 | Start-sleep -milliseconds 500 23 | } 24 | } -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/New-ISOFileFromFolder.ps1: -------------------------------------------------------------------------------- 1 | Function New-ISOFileFromFolder{ 2 | <# 3 | .SYNOPSIS 4 | Creates an ISO file from a filepath 5 | #> 6 | param( 7 | [Parameter(Mandatory=$true)] 8 | [String]$FilePath, 9 | [Parameter(Mandatory=$true)] 10 | [String]$Name, 11 | [Parameter(Mandatory=$true)] 12 | [String]$ResultFullFileName 13 | ) 14 | write-host "Creating ISO $Name" -ForegroundColor Green 15 | 16 | $fsi = New-Object -ComObject IMAPI2FS.MsftFileSystemImage 17 | $dftd = New-Object -ComObject IMAPI2.MsftDiscFormat2Data 18 | $Recorder = New-Object -ComObject IMAPI2.MsftDiscRecorder2 19 | 20 | $fsi.FileSystemsToCreate = 7 21 | $fsi.VolumeName = $Name 22 | $fsi.FreeMediaBlocks = 1000000 #default 332800 23 | 24 | 25 | $fsi.Root.AddTreeWithNamedStreams($FilePath,$false) 26 | 27 | 28 | 29 | $resultimage = $fsi.CreateResultImage() 30 | $resultStream = $resultimage.ImageStream 31 | 32 | 33 | Write-IStreamToFile $resultStream $ResultFullFileName 34 | 35 | 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/Remove-InvalidFileNameChars.ps1: -------------------------------------------------------------------------------- 1 | Function Remove-InvalidFileNameChars { 2 | [CmdletBinding()] 3 | param( 4 | [Parameter(Mandatory = $true, 5 | Position = 0, 6 | ValueFromPipeline = $true, 7 | ValueFromPipelineByPropertyName = $true)] 8 | [String]$Name 9 | ) 10 | 11 | $invalidChars = [IO.Path]::GetInvalidFileNameChars() -join '' 12 | $re = "[{0}]" -f [RegEx]::Escape($invalidChars) 13 | return ($Name -replace $re) 14 | } 15 | -------------------------------------------------------------------------------- /PSModules/Cloud.Ready.Software.Windows/Unzip-Item.ps1: -------------------------------------------------------------------------------- 1 | function Unzip-Item 2 | { 3 | [CmdletBinding()] 4 | Param 5 | ( 6 | # The full source-filepath of the file that should be unzipped 7 | [Parameter(Mandatory=$true, 8 | ValueFromPipelineByPropertyName=$true)] 9 | [Alias('Fullname')] 10 | $SourcePath, 11 | 12 | # The full Destionation-path where it should be unzipped 13 | [String] 14 | $DestinationPath 15 | ) 16 | process 17 | { 18 | if (-not (Test-Path $DestinationPath)){New-Item -Path $DestinationPath -ItemType directory} 19 | Unblock-File $DestinationPath 20 | $helper = New-Object -ComObject Shell.Application 21 | $files = $helper.NameSpace($SourcePath).Items() 22 | $helper.NameSpace($DestinationPath).CopyHere($files) | Out-Null 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /PSModules/Img/waldo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSModules/Img/waldo.png -------------------------------------------------------------------------------- /PSModules/InstallModule.ps1: -------------------------------------------------------------------------------- 1 | if (!($env:PSModulePath.ToString().Contains($PSScriptRoot))){ 2 | [environment]::SetEnvironmentVariable('PSModulePath', $env:PSModulePath + ';' + $PSScriptRoot, 'Machine') 3 | $env:PSModulePath = $env:PSModulePath + ';' + $PSScriptRoot 4 | } 5 | 6 | Write-host "Loading Cloud.Ready.Software.NAV..." -ForegroundColor Green 7 | Import-module Cloud.Ready.Software.NAV -Force 8 | Write-host "Loading Cloud.Ready.Software.PowerShell..." -ForegroundColor Green 9 | Import-module Cloud.Ready.Software.PowerShell -Force 10 | Write-host "Loading Cloud.Ready.Software.SQL..." -ForegroundColor Green 11 | Import-module Cloud.Ready.Software.SQL -Force 12 | Write-host "Loading Cloud.Ready.Software.Windows..." -ForegroundColor Green 13 | Import-module Cloud.Ready.Software.Windows -Force -------------------------------------------------------------------------------- /PSModules/UnInstallModule.ps1: -------------------------------------------------------------------------------- 1 | #Remove Module Path 2 | $ModulePaths = $env:PSModulePath -split ';' 3 | $NewModulePaths = @() 4 | foreach ($ModulePath in $ModulePaths){ 5 | if (!($ModulePath.Contains('Cloud.Ready.Software.PowerShell'))){ 6 | $NewModulePaths += $ModulePath 7 | } 8 | } 9 | 10 | $NewPSModulePath = ($NewModulePaths | select -Unique) -join ';' 11 | [environment]::SetEnvironmentVariable('PSModulePath', $NewPSModulePath, 'Machine') 12 | $env:PSModulePath = $NewPSModulePath -------------------------------------------------------------------------------- /PSModules/UpdateModule.ps1: -------------------------------------------------------------------------------- 1 | Remove-Item $profile.AllUsersCurrentHost -Force -ErrorAction SilentlyContinue 2 | 3 | 4 | . (Join-Path $PSScriptRoot 'UnInstallModule.ps1') 5 | 6 | . (Join-Path $PSScriptRoot 'InstallModule.ps1') 7 | . (Join-Path $PSScriptRoot 'CreateProfileInISE.ps1') -------------------------------------------------------------------------------- /PSModules/UpdateProfile.ps1: -------------------------------------------------------------------------------- 1 | if (!(Test-Path $PROFILE)) { 2 | New-Item -Path $PROFILE -Type File -Force 3 | } 4 | 5 | if (!(Get-Content $PROFILE | %{$_ -match 'Cloud.Ready.Software.PowerShell.Start-NAVVersionModuleSearch'})) { 6 | 7 | "# Cloud.Ready.Software.PowerShell.Start-NAVVersionModuleSearch 8 | if (Get-Command Start-NAVVersionModuleSearch -errorAction SilentlyContinue) 9 | { 10 | Start-NAVVersionModuleSearch 11 | }" >> $PROFILE 12 | 13 | } -------------------------------------------------------------------------------- /PSScripts/AppSource/testCode.ps1: -------------------------------------------------------------------------------- 1 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 2 | 3 | $TenantID = "123" 4 | $ClientID = "456" 5 | $ClientSecret = "789" 6 | 7 | $authcontext = New-BcAuthContext ` 8 | -clientID $clientId ` 9 | -clientSecret $clientSecret ` 10 | -tenantID $tenantId ` 11 | -scopes 'https://api.partner.microsoft.com/.default' 12 | 13 | $Products = Get-AppSourceProduct -authContext $authcontext 14 | $Products.Count 15 | 16 | get-command *AppSource* -------------------------------------------------------------------------------- /PSScripts/DevOps/GetProjects.ps1: -------------------------------------------------------------------------------- 1 | # static [string] $ApiVersionV1 = "api-version=1.0" 2 | # static [string] $ApiVersionV2 = "api-version=2.0-preview" 3 | # static [string] $ApiVersionV3 = "api-version=3.0-preview.1" 4 | # static [string] $ApiVersionV4 = "api-version=4.0-preview" 5 | 6 | 7 | $PAT = 'OmoybmpydHR5Z3lwbHNwejI0NWtiYmFnbDNwaGtqcnBtMjJ4YWJtMmc3b21zcW1vN3Z3YWE=' 8 | 9 | $Projects = 10 | Invoke-RestMethod -Method Get ` 11 | -Uri "https://dev.azure.com/msdyn365bc/_apis/projects/?api-version=4.1" ` 12 | -Headers @{ 13 | "Authorization" = "Basic " + " " + $PAT 14 | } 15 | $Projects 16 | $Projects.count 17 | $projects.value 18 | 19 | 20 | 21 | 22 | $PAT = '6chyhhxk4zdrijsdg6a2bfygdna33tvbvzheukq4kbkdv4ebux2a' 23 | $PATBase64 = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($PAT)) 24 | 25 | $Projects = 26 | Invoke-RestMethod -Method Get ` 27 | -Uri "https://dev.azure.com/msdyn365bc/_apis/projects/?api-version=4.1" ` 28 | -Headers @{ 29 | "Authorization" = "Basic " + " " + $PATBase64 30 | } 31 | 32 | $Projects 33 | $Projects.count 34 | $projects.value -------------------------------------------------------------------------------- /PSScripts/File Operations/Backup Files newer then date.ps1: -------------------------------------------------------------------------------- 1 |  2 | 3 | $Files = get-childitem D:\==WORKINGFOLDER -File -Recurse | where LastWriteTime -ge (Get-date -Day 1 -Month 1 -Year 2013 -Hour 00 -Minute 00) 4 | 5 | foreach ($File in $Files) { 6 | $DestinationDir = $File.Directory -replace 'D:\\==WORKINGFOLDER','C:\_Workingfolder' 7 | if (-not (test-path $DestinationDir)) {New-Item -Path $DestinationDir -ItemType directory} 8 | Copy-Item -Path $File.FullName -Destination (Join-Path $DestinationDir $File.Name) -Recurse 9 | } -------------------------------------------------------------------------------- /PSScripts/File Operations/Create ISO Image From Zip/4. CreateISOImageFromCumulativeUpdate.ps1: -------------------------------------------------------------------------------- 1 | $ZipFIle = "D:\Installs\493041_intl_i386_zip.exe" 2 | 3 | $TmpLocation = 'D:\Temp' 4 | $IsoDirectory = 'D:\Installs\' 5 | 6 | $IsoFile = 7 | New-NAVCumulativeUpdateISOFile ` 8 | -CumulativeUpdateFullPath $ZipFIle ` 9 | -TmpLocation $TmpLocation ` 10 | -IsoDirectory $IsoDirectory 11 | 12 | -------------------------------------------------------------------------------- /PSScripts/File Operations/Create ISO Image From Zip/4. CreateISOImageFromZip.ps1: -------------------------------------------------------------------------------- 1 | $ZipFIle = "C:\_Downloads\Dynamics.100.DE.2087085.DVD.zip" 2 | $TmpLocation = 'C:\TmpIsoCreation\2017' 3 | $ISOName = 'NAV_10_DE_RTM' 4 | $IsoFileName = '\\waldonas2\public\Software\$Microsoft\Dynamics NAV\NAV 2017' + "\$ISOName.iso" 5 | 6 | 7 | IF (Test-Path $TmpLocation){ 8 | if (Confirm-YesOrNo -title "Remove $TmpLocation" -message "Do you want to remove $TmpLocation ?") { 9 | Remove-Item -Path $TmpLocation -Recurse 10 | } else { 11 | Write-Error "'$TmpLocation' should not exist. Please remove first" 12 | break 13 | } 14 | } 15 | New-Item -ItemType directory -Path $TmpLocation 16 | 17 | write-host "Unzipping to '$TmpLocation'" 18 | Unzip-Item -SourcePath $ZipFIle -DestinationPath $TmpLocation 19 | 20 | Write-host "Creating ISO file '$ISOFileName'" 21 | New-ISOFileFromFolder -FilePath $TmpLocation -Name $ISOName -ResultFullFileName $IsoFileName 22 | -------------------------------------------------------------------------------- /PSScripts/File Operations/MoveMoviesFromiPhotoToSelfmadeVideos.ps1: -------------------------------------------------------------------------------- 1 | $SourcePath = get-item '\\waldonas\photo\iPhoto' 2 | $DestinationPath = get-item '\\waldonas\video\Selfmade' 3 | 4 | Write-Progress -Activity "Getting all movies from $SourcePath" 5 | $Movies = Get-ChildItem -Path $SourcePath -Recurse | where Extension -In '.mov','.AVI','.MOV','.mp4','.MPG' 6 | 7 | $Count = $movies.Count 8 | $i = 0 9 | foreach ($Movie in $Movies) { 10 | $DestinationDir = $Movie.Directory.FullName -replace ($SourcePath.FullName -replace '\\','\\'), $DestinationPath.FullName 11 | #if (-not (test-path $DestinationDir)) {New-Item -Path $DestinationDir -ItemType directory} 12 | 13 | $i++ 14 | Write-Progress -Activity "Moving $($Movie.FullName) to $DestinationDir" -PercentComplete (($i/$count)*100) 15 | 16 | #Copy-Item -Path $Movie.FullName -Destination (Join-Path $DestinationDir $Movie.Name) -Recurse 17 | 18 | Write-Host "From: $($Movie.FullName)" 19 | write-host "To: $(Join-Path $DestinationDir $Movie.Name)" 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/1_InstallDocker.ps1: -------------------------------------------------------------------------------- 1 | Install-WindowsFeature -Name Containers 2 | Uninstall-WindowsFeature Windows-Defender 3 | Restart-Computer -Force 4 | 5 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false -Force 6 | Install-Module DockerProvider -Confirm:$false -Force 7 | Install-Package Docker -ProviderName DockerProvider -Confirm:$false -Force 8 | Start-Service docker 9 | 10 | docker image pull mcr.microsoft.com/businesscentral/sandbox 11 | 12 | #change agent user to "system" -------------------------------------------------------------------------------- /PSScripts/Hetzner/BCTechDaysDemo/PublishApps.ps1: -------------------------------------------------------------------------------- 1 | $AppFolder = "C:\Users\Administrator\Desktop\Scripts\BCTechDaysDemo\apps" 2 | $AppFiles = Get-childItem $AppFolder 3 | 4 | $ContainerName = 'BCTechDays' 5 | 6 | foreach ($AppFile in $AppFiles) 7 | { 8 | Publish-BcContainerApp -containerName $ContainerName -appFile $AppFile.FullName -skipVerification -syncMode ForceSync 9 | 10 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/BCTechDaysDemo/Unpublish all waldo-apps.ps1: -------------------------------------------------------------------------------- 1 | Invoke-ScriptInBcContainer -containerName PerfTest -scriptblock { 2 | Get-navappinfo bc | where Publisher -eq 'waldo' | Uninstall-NAVApp -verbose 3 | Get-navappinfo bc | where Publisher -eq 'waldo' | Unpublish-NAVApp -verbose 4 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/BCTechDaysDemo/apps/iFacto Business Solutions NV_iFacto Telemetry_23.2.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/BCTechDaysDemo/apps/iFacto Business Solutions NV_iFacto Telemetry_23.2.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/BCTechDaysDemo/apps/waldo_TelemetryPTE_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/BCTechDaysDemo/apps/waldo_TelemetryPTE_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/DemoEnv/InstallExternalDeployer.ps1: -------------------------------------------------------------------------------- 1 | Enter-BcContainer qa 2 | 3 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 4 | 5 | install-module ALOps.ExternalDeployer -Force -confirm:$true 6 | 7 | import-module ALOps.ExternalDeployer 8 | 9 | Install-ALOpsExternalDeployer 10 | 11 | New-ALOpsExternalDeployer -ServerInstance BC -------------------------------------------------------------------------------- /PSScripts/Hetzner/DemoEnv/Untitled14.ps1: -------------------------------------------------------------------------------- 1 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 2 | 3 | install-module ALOps.ExternalDeployer -Force 4 | 5 | import-module ALOps.ExternalDeployer 6 | 7 | Install-ALOpsExternalDeployer 8 | 9 | New-ALOpsExternalDeployer -ServerInstance BC -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/Microsoft_Performance Toolkit Samples.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/Microsoft_Performance Toolkit Samples.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext1_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext1_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext2_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext2_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext3_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext3_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext4_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext4_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext5_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext5_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext6_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext6_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext7_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext7_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext8_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfToolDemos_Ext8_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/Apps/waldo_BCPerfTool_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/Demos/Apps/waldo_BCPerfTool_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/CertificateCreation.ps1: -------------------------------------------------------------------------------- 1 |  2 | # Download: https://wiki.openssl.org/index.php/Binaries 3 | 4 | Set-location "C:\Program Files\OpenSSL-Win64\bin" 5 | 6 | openssl req -new -newkey rsa:2048 -nodes -out star_waldo_be.csr -keyout star_waldo_be.key -subj "/C=BE/ST=Antwerp/L=Vosselaar/O=Dynex bv/CN=*.waldo.be" 7 | openssl pkcs12 -inkey star_waldo_be.key -in star_waldo_be.pem -export -out star_waldo_be.pfx 8 | 9 | openssl pkcs12 -in star_waldo_be.pfx -out star_waldo_be.crt -nokeys -clcerts 10 | 11 | openssl x509 -inform pem -in star_waldo_be.crt -outform der -out star_waldo_be.cer 12 | 13 | #openssl pkcs12 -in star_waldo_be.pfx -nocerts -out star_waldo_be.key.pem 14 | 15 | #openssl rsa -in wildcard.waldo.be.key.pem -out wildcard.waldo.be.key 16 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/CreateContainer.ps1: -------------------------------------------------------------------------------- 1 | $containerName = 'Sandbox1' 2 | $LicenseFile = "https://www.dropbox.com/s/675hqssxew9pdkm/Latest.flf?dl=1" 3 | $publicdnsname = 'demos.waldo.be' 4 | $artifactUrl = Get-BCArtifactUrl -version 20.4.44313.45693 5 | 6 | $UserName = 'admin' 7 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 8 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 9 | 10 | $myscripts = New-Object System.Collections.Generic.List[System.Object] 11 | $myscripts.Add("C:\BCContainerSetup\AdditionalOutput.ps1") 12 | $myscripts.Add("C:\BCContainerSetup\SetupCertificate.ps1") 13 | $myscripts.Add("C:\BCContainerSetup\star_waldo_be.pfx") 14 | 15 | if ($psscriptroot) { 16 | . (join-path $psscriptroot "Create-Container.ps1") 17 | } 18 | 19 | Create-BCContainer ` -containerName $containerName ` -artifactUrl $artifactUrl ` -ContainerCredential $ContainerCredential ` -myscripts $myscripts.ToArray() ` -publicdnsname $publicdnsname -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/InstallTraefik.ps1: -------------------------------------------------------------------------------- 1 | Copy-Item -Path "C:\Users\Administrator\Desktop\Scripts\TrainingEnv\traefik.yml" -Destination "C:\ProgramData\BcContainerHelper\traefikforbc\config\traefik.yml" -Force 2 | 3 | docker pull traefik:windowsservercore-1809 4 | 5 | 6 | 7 | 8 | docker run --name traefik -p 8080:8080 -p 443:443 -p 80:80 -p 7047:7047 -p 7048:7048 -p 7049:7049 -p 9000:9000 --restart always -d -v "c:\programdata\bccontainerhelper\traefikforbc\config:c:/etc/traefik" -v \\.\pipe\docker_engine:\\.\pipe\docker_engine traefik:windowsservercore-1809 --providers.docker.endpoint=npipe:////./pipe/docker_engine 9 | 10 | Docker stop traefik 11 | docker rm traefik 12 | docker run --name traefik -p 8080:8080 -p 443:443 -p 80:80 -p 7047:7047 -p 7048:7048 -p 7049:7049 -p 9000:9000 --restart always -d -v "C:\ProgramData\BcContainerHelper\traefikforbc\config:c:/etc/traefik" -v \\.\pipe\docker_engine:\\.\pipe\docker_engine traefik:windowsservercore-1809 --providers.docker.endpoint=npipe:////./pipe/docker_engine 13 | docker logs traefik 14 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/InstallTraefikWithBCCH.ps1: -------------------------------------------------------------------------------- 1 | Setup-TraefikContainerForBcContainers ` -PublicDnsName 'waldo.be' ` -CrtFile "C:\ProgramData\BcContainerHelper\traefikforbc.old\config\star_waldo_be.crt" ` -CrtKeyFile "C:\ProgramData\BcContainerHelper\traefikforbc.old\config\star_waldo_be.key" ` -IP '157.90.94.98' ` -Recreate ` -overrideDefaultBinding ` -additionalParameters -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/PublishBCPTSamplesToAllContainers.ps1: -------------------------------------------------------------------------------- 1 | $UserName = 'admin' 2 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 3 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 4 | 5 | $Containers = Get-BcContainers 6 | 7 | Get-BcContainers | % { 8 | 9 | write-host "Publishing apps to container $($_)" -ForegroundColor Yellow 10 | 11 | Publish-BcContainerApp ` 12 | -containerName $_ ` -appFile "C:\Users\Administrator\Desktop\Scripts\TrainingEnv\Apps\Microsoft_Performance Toolkit Samples.app" ` -skipVerification ` 13 | -install ` -ignoreIfAppExists ` -syncMode ForceSync ` -sync ` -useDevEndpoint ` -credential $ContainerCredential ` -ErrorAction Continue 14 | 15 | 16 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/RemoveBCContainers.ps1: -------------------------------------------------------------------------------- 1 | Get-BcContainers | % { 2 | Remove-BcContainer $_ 3 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/Demos/traefik.yml: -------------------------------------------------------------------------------- 1 | global: 2 | checkNewVersion: true 3 | sendAnonymousUsage: true 4 | entryPoints: 5 | web: 6 | address: ':80' 7 | http: 8 | redirections: 9 | entryPoint: 10 | to: websecure 11 | scheme: https 12 | websecure: 13 | address: ':443' 14 | bc-soap: 15 | address: ':7047' 16 | bc-odata: 17 | address: ':7048' 18 | bc-dev: 19 | address: ':7049' 20 | http: 21 | routers: 22 | waldobe: 23 | rule: Host(`waldo.be`) 24 | tls: 25 | passthrough: true 26 | serversTransport: 27 | insecureSkipVerify: true 28 | tls: 29 | certificates: 30 | - certFile: /etc/traefik/star_waldo_be.cer 31 | keyFile: /etc/traefik/star_waldo_be.key 32 | log: 33 | filePath: /etc/traefik/traefik.log 34 | accessLog: 35 | filePath: /etc/traefik/traefik-access.log 36 | api: 37 | insecure: true 38 | dashboard: true 39 | ping: {} 40 | providers: 41 | file: 42 | directory: /etc/traefik/dynamic-conf 43 | watch: true 44 | docker: 45 | endpoint: 'npipe:////./pipe/docker_engine' 46 | defaultRule: Host(`server1.waldo.be`) 47 | exposedByDefault: false 48 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/EnableTLS.ps1: -------------------------------------------------------------------------------- 1 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 -------------------------------------------------------------------------------- /PSScripts/Hetzner/InstallAgent.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot "Connect-Warp10VSTSAgent.ps1") 2 | 3 | Connect-Warp10VSTSAgent ` 4 | -DevOpsUrl "https://dev.azure.com/NAVTechDays19" ` 5 | -AgentPool "WaldoHetzner" ` 6 | -AgentName "WaldoHetzner01" ` 7 | -AgentFolder "C:\vsts-agent-win-x64-2.155.1_2" ` 8 | -Verbose 9 | # also add PAT to the script -------------------------------------------------------------------------------- /PSScripts/Hetzner/InstallDocker.ps1: -------------------------------------------------------------------------------- 1 | # Install-WindowsFeature Hyper-V, Containers -Restart 2 | # Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false -Force 3 | # Install-Module DockerProvider -Confirm:$false -Force 4 | # Install-Package Docker -ProviderName DockerProvider -Confirm:$false -Force 5 | 6 | Invoke-WebRequest -Uri get.mirantis.com/install.ps1 -OutFile c:\temp\Install-Mirantis.ps1 7 | 8 | psedit c:\temp\Install-Mirantis.ps1 -------------------------------------------------------------------------------- /PSScripts/Hetzner/PerformanceTesting/Unpublish all waldo-apps.ps1: -------------------------------------------------------------------------------- 1 | Invoke-ScriptInBcContainer -containerName PerfTest -scriptblock { 2 | Get-navappinfo bc | where Publisher -eq 'waldo' | Uninstall-NAVApp -verbose 3 | Get-navappinfo bc | where Publisher -eq 'waldo' | Unpublish-NAVApp -verbose 4 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/Microsoft_Performance Toolkit Samples.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/Microsoft_Performance Toolkit Samples.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext1_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext1_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext2_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext2_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext3_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext3_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext4_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext4_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext5_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext5_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext6_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext6_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext7_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext7_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext8_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfToolDemos_Ext8_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfTool_1.0.0.0.app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/Hetzner/TrainingEnv/Apps/waldo_BCPerfTool_1.0.0.0.app -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/CertificateCreation.ps1: -------------------------------------------------------------------------------- 1 |  2 | # Download: https://wiki.openssl.org/index.php/Binaries 3 | 4 | Set-location "C:\Program Files\OpenSSL-Win64\bin" 5 | 6 | # best to do in cmd 7 | 8 | openssl req -new -newkey rsa:2048 -nodes -out star_waldo_be.csr -keyout star_waldo_be.key -subj "/C=BE/ST=Antwerp/L=Vosselaar/O=Dynex bv/CN=*.waldo.be" 9 | openssl pkcs12 -inkey star_waldo_be.key -in star_waldo_be.pem -export -out star_waldo_be.pfx 10 | 11 | openssl pkcs12 -in star_waldo_be.pfx -out star_waldo_be.crt -nokeys -clcerts 12 | 13 | openssl x509 -inform pem -in star_waldo_be.crt -outform der -out star_waldo_be.cer 14 | 15 | #openssl pkcs12 -in star_waldo_be.pfx -nocerts -out star_waldo_be.key.pem 16 | 17 | #openssl rsa -in wildcard.waldo.be.key.pem -out wildcard.waldo.be.key 18 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/CreateContainer.ps1: -------------------------------------------------------------------------------- 1 | $containerName = 'Sandbox1' 2 | $LicenseFile = "https://www.dropbox.com/s/675hqssxew9pdkm/Latest.flf?dl=1" 3 | $publicdnsname = 'Training.waldo.be' 4 | $artifactUrl = Get-BCArtifactUrl -version 20.4.44313.45693 5 | 6 | $UserName = 'admin' 7 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 8 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 9 | 10 | $myscripts = New-Object System.Collections.Generic.List[System.Object] 11 | $myscripts.Add("C:\BCContainerSetup\AdditionalOutput.ps1") 12 | $myscripts.Add("C:\BCContainerSetup\SetupCertificate.ps1") 13 | $myscripts.Add("C:\BCContainerSetup\star_waldo_be.pfx") 14 | 15 | if ($psscriptroot) { 16 | . (join-path $psscriptroot "Create-Container.ps1") 17 | } 18 | 19 | Create-BCContainer ` -containerName $containerName ` -artifactUrl $artifactUrl ` -ContainerCredential $ContainerCredential ` -myscripts $myscripts.ToArray() ` -publicdnsname $publicdnsname -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/InstallTraefik.ps1: -------------------------------------------------------------------------------- 1 | Copy-Item -Path "C:\Users\Administrator\Desktop\Scripts\TrainingEnv\traefik.yml" -Destination "C:\ProgramData\BcContainerHelper\traefikforbc\config\traefik.yml" -Force 2 | 3 | docker pull traefik:windowsservercore-1809 4 | 5 | 6 | 7 | 8 | docker run --name traefik -p 8080:8080 -p 443:443 -p 80:80 -p 7047:7047 -p 7048:7048 -p 7049:7049 -p 9000:9000 --restart always -d -v "c:\programdata\bccontainerhelper\traefikforbc\config:c:/etc/traefik" -v \\.\pipe\docker_engine:\\.\pipe\docker_engine traefik:windowsservercore-1809 --providers.docker.endpoint=npipe:////./pipe/docker_engine 9 | 10 | Docker stop traefik 11 | docker rm traefik 12 | docker run --name traefik -p 8080:8080 -p 443:443 -p 80:80 -p 7047:7047 -p 7048:7048 -p 7049:7049 -p 9000:9000 --restart always -d -v "C:\ProgramData\BcContainerHelper\traefikforbc\config:c:/etc/traefik" -v \\.\pipe\docker_engine:\\.\pipe\docker_engine traefik:windowsservercore-1809 --providers.docker.endpoint=npipe:////./pipe/docker_engine 13 | docker logs traefik 14 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/InstallTraefikWithBCCH.ps1: -------------------------------------------------------------------------------- 1 | Setup-TraefikContainerForBcContainers ` -PublicDnsName 'waldo.be' ` -CrtFile "C:\ProgramData\BcContainerHelper\traefikforbc.old\config\star_waldo_be.crt" ` -CrtKeyFile "C:\ProgramData\BcContainerHelper\traefikforbc.old\config\star_waldo_be.key" ` -IP '157.90.94.98' ` -Recreate ` -overrideDefaultBinding ` -additionalParameters -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/PublishBCPTSamplesToAllContainers.ps1: -------------------------------------------------------------------------------- 1 | $UserName = 'admin' 2 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 3 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 4 | 5 | $Containers = Get-BcContainers 6 | 7 | Get-BcContainers | % { 8 | 9 | write-host "Publishing apps to container $($_)" -ForegroundColor Yellow 10 | 11 | Publish-BcContainerApp ` 12 | -containerName $_ ` -appFile "C:\Users\Administrator\Desktop\Scripts\TrainingEnv\Apps\Microsoft_Performance Toolkit Samples.app" ` -skipVerification ` 13 | -install ` -ignoreIfAppExists ` -syncMode ForceSync ` -sync ` -useDevEndpoint ` -credential $ContainerCredential ` -ErrorAction Continue 14 | 15 | 16 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/RemoveBCContainers.ps1: -------------------------------------------------------------------------------- 1 | Get-BcContainers | % { 2 | Remove-BcContainer $_ 3 | } -------------------------------------------------------------------------------- /PSScripts/Hetzner/TrainingEnv/traefik.yml: -------------------------------------------------------------------------------- 1 | global: 2 | checkNewVersion: true 3 | sendAnonymousUsage: true 4 | entryPoints: 5 | web: 6 | address: ':80' 7 | http: 8 | redirections: 9 | entryPoint: 10 | to: websecure 11 | scheme: https 12 | websecure: 13 | address: ':443' 14 | bc-soap: 15 | address: ':7047' 16 | bc-odata: 17 | address: ':7048' 18 | bc-dev: 19 | address: ':7049' 20 | http: 21 | routers: 22 | waldobe: 23 | rule: Host(`waldo.be`) 24 | tls: 25 | passthrough: true 26 | serversTransport: 27 | insecureSkipVerify: true 28 | tls: 29 | certificates: 30 | - certFile: /etc/traefik/star_waldo_be.cer 31 | keyFile: /etc/traefik/star_waldo_be.key 32 | log: 33 | filePath: /etc/traefik/traefik.log 34 | accessLog: 35 | filePath: /etc/traefik/traefik-access.log 36 | api: 37 | insecure: true 38 | dashboard: true 39 | ping: {} 40 | providers: 41 | file: 42 | directory: /etc/traefik/dynamic-conf 43 | watch: true 44 | docker: 45 | endpoint: 'npipe:////./pipe/docker_engine' 46 | defaultRule: Host(`server1.waldo.be`) 47 | exposedByDefault: false 48 | -------------------------------------------------------------------------------- /PSScripts/Hetzner/install 7zip.ps1: -------------------------------------------------------------------------------- 1 | $TempFile = join-path $env:temp '7zip.exe' 2 | Invoke-WebRequest -uri "https://www.7-zip.org/a/7z1900-x64.exe" -OutFile $TempFile 3 | 4 | cmd /c "(start /wait $((get-item $TempFile).FullName) /S)" 5 | -------------------------------------------------------------------------------- /PSScripts/ISE Environment/Deploy Modules.ps1: -------------------------------------------------------------------------------- 1 | $PSModulePaths = ($env:PSModulePath).Split(';') 2 | 3 | $PSUserModulePath = $PSModulePaths.Where({$_ -Match 'Users'}) 4 | 5 | if ([string]::IsNullOrEmpty($PSUserModulePath)){ 6 | write-error 'Module Path for Users not found.' 7 | break 8 | } 9 | 10 | $waldoModulePath = join-path $PSUserModulePath 'Microsoft.Dynamics.Nav.waldo' 11 | 12 | if (test-path $waldoModulePath) { 13 | $Overwrite = Read-Host -Prompt "'$waldoModulePath' already exists, overwrite? (y/n)" 14 | if ($Overwrite -in 'n','N','no','neen'){ 15 | write-warning 'Nothing executed' 16 | break 17 | } elseif (-not($overwrite -in 'y','Y','yes','ja')){ 18 | write-error 'Invalid input' 19 | break 20 | } 21 | } 22 | 23 | $null = Remove-Item -Path $waldoModulePath -Recurse 24 | $null = New-Item -Path $waldoModulePath -ItemType directory -Force 25 | 26 | $CurrentPath = Get-Item $psise.CurrentFile.FullPath 27 | get-childitem (join-path $CurrentPath.Directory 'Modules') | 28 | copy-item -Destination $waldoModulePath -Recurse -Force 29 | 30 | -------------------------------------------------------------------------------- /PSScripts/ISE Environment/Modules/Microsoft.Dynamics.Nav.waldo.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/ISE Environment/Modules/Microsoft.Dynamics.Nav.waldo.psd1 -------------------------------------------------------------------------------- /PSScripts/ISE Environment/Modules/Microsoft.Dynamics.Nav.waldo.psm1: -------------------------------------------------------------------------------- 1 | . (join-path $PSScriptRoot .\Invoke-SQL.ps1) 2 | Export-ModuleMember -Function Invoke-SQL -------------------------------------------------------------------------------- /PSScripts/ISE Environment/Modules/SQL/Invoke-SQL.ps1: -------------------------------------------------------------------------------- 1 | #Source: http://stackoverflow.com/questions/8423541/how-do-you-run-a-sql-server-query-from-powershell 2 | function Invoke-SQL { 3 | param( 4 | [string] $DatabaseServer = ".", 5 | [string] $DatabaseName = "Master", 6 | [string] $SQLCommand = $(throw "Please specify a query.") 7 | ) 8 | 9 | $connectionString = "Data Source=$DatabaseServer; Integrated Security=SSPI; Initial Catalog=$DatabaseName" 10 | 11 | write-Host -ForegroundColor Green "Invoke-SQL :'$SQLCommand'" 12 | 13 | $connection = new-object system.data.SqlClient.SQLConnection($connectionString) 14 | $command = new-object system.data.sqlclient.sqlcommand($sqlCommand,$connection) 15 | $connection.Open() 16 | 17 | $adapter = New-Object System.Data.sqlclient.sqlDataAdapter $command 18 | $dataset = New-Object System.Data.DataSet 19 | $adapter.Fill($dataSet) | Out-Null 20 | 21 | $connection.Close() 22 | $dataSet.Tables 23 | 24 | } -------------------------------------------------------------------------------- /PSScripts/ISE Environment/Setup.ps1: -------------------------------------------------------------------------------- 1 | $code = 2 | { 3 | Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -WarningAction SilentlyContinue | out-null 4 | Import-Module 'C:\Program Files\Microsoft Dynamics NAV\80\Service\NavAdminTool.ps1' -WarningAction SilentlyContinue | Out-Null 5 | } 6 | $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load NAV 2015 CmdLets',$code,$null) 7 | 8 | $code = 9 | { 10 | Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -WarningAction SilentlyContinue | out-null 11 | Import-Module 'C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1' -WarningAction SilentlyContinue | Out-Null 12 | } 13 | $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load NAV 2016 CmdLets',$code,$null) 14 | 15 | $code = 16 | { 17 | Get-ChildItem 'S:\PowerShellScripts\PSFunctions' -Recurse -File | foreach {import-module $_.fullname} 18 | } 19 | $psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load waldo functions', $code, $null ) 20 | -------------------------------------------------------------------------------- /PSScripts/NAV Code Analysis/Export_Publishers.ps1: -------------------------------------------------------------------------------- 1 | $ObjectFile = "C:\temp\13.0.24012.0-W1.txt" 2 | $ExportTo = "C:\temp\Publishers" 3 | 4 | $ModuleToolAPIPath = "$env:USERPROFILE\Dropbox\GitHub\Waldo.Model.Tools\Revision.Model.Tools.Library - NoLicense" 5 | #import-module (join-path $ModuleToolAPIPath NavModelToolsAPI.dll) -WarningAction SilentlyContinue -ErrorAction Stop 6 | 7 | if (!(Test-Path $ExportTo)){ 8 | New-Item -Path $ExportTo -ItemType Directory 9 | } 10 | 11 | Export-NAVEventPublishers ` 12 | -ModuleToolAPIPath $ModuleToolAPIPath ` 13 | -SourceFile $ObjectFile ` 14 | -DestinationFolder $ExportTo ` 15 | -Verbose 16 | 17 | start $ExportTo -------------------------------------------------------------------------------- /PSScripts/NAV Code Analysis/LoadModelToolAPI.ps1: -------------------------------------------------------------------------------- 1 | #Load model 2 | $ModuleToolAPIPath = "$env:USERPROFILE\Dropbox\GitHub\Waldo.Model.Tools\Revision.Model.Tools.Library - NoLicense" 3 | import-module (join-path $ModuleToolAPIPath NavModelToolsAPI.dll) -WarningAction SilentlyContinue -ErrorAction Stop 4 | 5 | #Check License 6 | Check-License 7 | 8 | #Function - ModelToolAPI 9 | 10 | #Copy license to folder 11 | 12 | Check-License 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/Obsolete/CreateISOandZipOnAzureImage.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Install New DEV experience on a local environment 3 | Step 1: Execute this script on the Azure-VM 4 | Step 2: Copy the the files to a local machine in the folder 'C:\_Installs' 5 | Step 3: Execute the script "InstallOnLocalEnvironment.ps1" on the local environment. 6 | #> 7 | 8 | Find-Module | where author -eq waldo | Install-Module -Force #Make sure you trust my modules 9 | Import-Module -Name Cloud.Ready.Software.NAV 10 | 11 | #DVD 12 | Create-FolderIfNotExist -MyFolder 'C:\DOWNLOAD\' | Out-Null 13 | New-ISOFileFromFolder -FilePath 'C:\NAVDVD\W1' -Name 'NAVDVD' -ResultFullFileName 'C:\DOWNLOAD\NAVDVD.iso' 14 | 15 | #DEVTools 16 | Get-ChildItem -Path 'C:\DEMO\New Developer Experience' | Where Name -NotLike '*Bac*' | Create-ZipFileFromPipedItems -zipfilename 'C:\DOWNLOAD\NewDEVTools.zip' 17 | 18 | Start 'C:\DOWNLOAD\' 19 | -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/Obsolete/FixScripts/01_BackupDb.ps1: -------------------------------------------------------------------------------- 1 | if (!(test-path c:\backup\Backup.bak)){ 2 | Find-Module | where author -eq waldo | install-module -force 3 | Import-Module -Name Cloud.Ready.Software.NAV 4 | Import-NAVModules 5 | 6 | $backup = Backup-NAVDatabase -ServerInstance NAV 7 | New-Item -Path c:\BACKUP -ItemType Directory -ErrorAction SilentlyContinue 8 | $backup | Move-Item -Destination c:\backup\Backup.bak 9 | } 10 | start C:\BACKUP -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/Obsolete/FixScripts/02_FixBrokenEnvironment.ps1: -------------------------------------------------------------------------------- 1 | Import-NAVModules 2 | 3 | $Backup = Get-Item C:\BACKUP\Backup.bak 4 | 5 | $Defaultinstance = get-navserverinstancedetails -ServerInstance NAV 6 | 7 | Set-NAVServerInstance -ServerInstance NAV -stop 8 | Set-NAVServerInstance -ServerInstance Navision_main -Stop 9 | 10 | Restore-SQLBackupFile ` -BackupFile $Backup.FullName ` -DatabaseServer $Defaultinstance.DatabaseServer ` -DatabaseInstance $Defaultinstance.DatabaseInstance ` -DatabaseName $Defaultinstance.DatabaseName ` -TimeOut 0 Set-NAVServerInstance -ServerInstance NAV -Start 11 | Set-NAVServerInstance -ServerInstance Navision_main -Start 12 | 13 | Sync-NAVTenant -ServerInstance NAV -Mode Sync -Force 14 | Sync-NAVTenant -ServerInstance Navision_main -Mode Sync -Force 15 | 16 | Add-NAVEnvironmentCurrentUser -ServerInstance NAV -PermissionSetId SUPER 17 | Get-NAVServerInstance | ft -AutoSize 18 | -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/Obsolete/PrepareAzureVM.ps1: -------------------------------------------------------------------------------- 1 | #Install Git 2 | $GitExec = 'C:\DOWNLOAD\Git.exe' 3 | $GitDownloadURL = 'https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/Git-2.11.0.3-64-bit.exe' 4 | 5 | Invoke-WebRequest $GitDownloadURL -OutFile $GitExec 6 | Start-Process -FilePath $GitExec -ArgumentList "/VERYSILENT" 7 | 8 | 9 | #CopyDropboxFolder 10 | $ALSamplesOnDropbox = 'https://dl-web.dropbox.com/installer?authenticode_sign=True&build_no=18.4.32&juno=True&juno_use_program_files=True&plat=win&tag=eyJUQUdTIjoiREJQUkVBVVRIOjptc2llOjplSndOeThFS2drQVFBTkJma1RsSHpPek83RXpkbzhKQUNJeHVJcmpRR21td2R0RG8zX1AtM2hmYXpfUm9wdkVaQjlnWFVNMzNLcjNyVjMyODNsbzd4ZEtsODZGY3VNT0wwdExQVzJJVFZRMUJZRk5BamptbmNXaFN0MlpDSmxYeEVsZ0M3dGlSOTJhQ3F6WW5HSlNkaU5qdkR3OXpJQkV-QE1FVEEifQ&tag_token=AFwGRXyc0r87R2jXxKHV74_pLsMkSRfyOO1l6k8V--vw0A' 11 | $DropboxExec = 'C:\DOWNLOAD\Dropbox.exe' 12 | Invoke-WebRequest $ALSamplesOnDropbox -OutFile $DropboxExec 13 | Start-Process -FilePath $DropboxExec 14 | 15 | 16 | #Install waldo's modules 17 | Find-Module | where author -eq 'waldo' | Install-Module -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/VSIX/al-0.11.13957.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Developer Tools/VSIX/al-0.11.13957.vsix -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/VSIX/humao.rest-client-0.16.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Developer Tools/VSIX/humao.rest-client-0.16.0.vsix -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/VSIX/ms-mssql.mssql-1.2.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Developer Tools/VSIX/ms-mssql.mssql-1.2.0.vsix -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/VSIX/ms-vscode.PowerShell-1.5.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Developer Tools/VSIX/ms-vscode.PowerShell-1.5.0.vsix -------------------------------------------------------------------------------- /PSScripts/NAV Developer Tools/VSIX/waldo.crs-al-language-extension-0.0.8.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Developer Tools/VSIX/waldo.crs-al-language-extension-0.0.8.vsix -------------------------------------------------------------------------------- /PSScripts/NAV Docker/GetAllTagsFromDockerHub.ps1: -------------------------------------------------------------------------------- 1 | $ResultingObject = @() 2 | 3 | $result = Invoke-WebRequest -Uri "https://registry.hub.docker.com/v2/repositories/microsoft/dynamics-nav/tags/?page_size=250" 4 | # $result = Invoke-WebRequest -Uri "https://registry.hub.docker.com/v2/repositories/microsoft/bcsandbox/tags/?page_size=250" 5 | $JsonObject = ConvertFrom-Json -InputObject $result.Content 6 | $ResultingObject = $JsonObject.results 7 | $ParentId = 1 8 | 9 | while ($JsonObject.next) { 10 | $result = Invoke-WebRequest -Uri $JsonObject.next 11 | $JsonObject = ConvertFrom-Json -InputObject $result.Content 12 | $ResultingObject += $JsonObject.results 13 | 14 | $percCompleted = [Math]::Round($ResultingObject.Count / $JsonObject.count, 4) * 100 15 | Write-Progress -Activity "Processing tags" -PercentComplete $percCompleted -ParentId $ParentId 16 | } 17 | break 18 | #$ResultingObject.Count 19 | #$ResultingObject[0] 20 | #$ResultingObject.name 21 | $ResultingObject | where name -like '*ltsc2019*' | select name 22 | $ResultingObject | where name -like '*ltsc2019*' | measure 23 | $ResultingObject | where name -like '*be*' | select name 24 | $ResultingObject | where name -like '*14.1*' | select name 25 | 26 | #$ResultingObject | where name -like '*be' | select name -------------------------------------------------------------------------------- /PSScripts/NAV Docker/GetAllTagsFromMSContainerServices.ps1: -------------------------------------------------------------------------------- 1 | # $Registry = "https://mcr.microsoft.com/v2/businesscentral/sandbox/tags/list" 2 | $Registry = "https://mcr.microsoft.com/v2/businesscentral/onprem/tags/list" 3 | #$Registry = "https://mcr.microsoft.com/v2/dynamics-nav/tags/list" 4 | 5 | $result = Invoke-WebRequest -Uri $Registry 6 | $JsonObject = ConvertFrom-Json -InputObject $result.Content 7 | $tags = $JsonObject.tags 8 | break 9 | $tags #All Tags 10 | $tags.count #Number of Tags 11 | $tags | where {$_ -like "*be*"} #All Belgian images 12 | $tags | where {$_ -like '*ltsc2019*'} #All ltsc2019 images 13 | $tags | where {$_ -like '*14.1*'} #All ltsc2019 images 14 | 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/Install Docker/Windows 10/Install-Portainer.ps1: -------------------------------------------------------------------------------- 1 | #Install Portainer 2 | docker pull portainer/portainer 3 | if (!(test-path C:\ProgramData\Portainer)){New-Item -Path C:\ProgramData\Portainer -ItemType Directory} 4 | docker run -d --restart always --name portainer --isolation process -h portainer -p 9000:9000 -v C:\ProgramData\Portainer:C:\Data -v //./pipe/docker_engine://./pipe/docker_engine portainer/portainer 5 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/Install Docker/Windows Server/01_UpdateDocker.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Unregister-PackageSource -ProviderName DockerMsftProvider -Name DockerDefault -Erroraction Ignore 3 | Register-PackageSource -ProviderName DockerMsftProvider -Name Docker -Erroraction Ignore -Location https://download.docker.com/components/engine/windows-server/index.json 4 | Install-Package -Name docker -ProviderName DockerMsftProvider -Update -Force 5 | #> 6 | 7 | #https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-server 8 | Get-Package -Name Docker -ProviderName DockerMsftProvider 9 | Find-Package -Name Docker -ProviderName DockerMsftProvider 10 | Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force 11 | 12 | # Start the Docker service. 13 | Start-Service Docker -------------------------------------------------------------------------------- /PSScripts/NAV Docker/Install Docker/Windows Server/02_ConfigureDocker.ps1: -------------------------------------------------------------------------------- 1 | #Start Docker Service 2 | get-service *Docker* | Where Status -eq 'Stopped' |Start-Service 3 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/Install Docker/Windows Server/03_ConfigureMachine.ps1: -------------------------------------------------------------------------------- 1 | New-Item -Path c:\_Docker -ItemType directory -ErrorAction SilentlyContinue 2 | New-Item -Path c:\_Docker\myfolder -ItemType directory -ErrorAction SilentlyContinue 3 | 4 | New-Item -Path c:\Demo -ItemType directory -ErrorAction SilentlyContinue 5 | New-Item -Path c:\myfolder -ItemType directory -ErrorAction SilentlyContinue -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/PSDev/CopyScriptsToContainer.ps1: -------------------------------------------------------------------------------- 1 | $from = "C:\Users\ericw\Dropbox (Personal)\GitHub\Cloud.Ready.Software.PowerShell\PSModules\Cloud.Ready.Software.NAV\Import-NAVModules.ps1" 2 | 3 | $pssession = Get-NavContainerSession navserver 4 | 5 | copy-item -Path $from -ToSession $pssession -Destination 'c:\program files\windowspowershell\modules\Cloud.Ready.Software.NAV\1.0.3.4\' -force -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Basically uses the navcontainerhelper. 3 | 4 | # Scenario 5 | You are usually working on the desktop of the dockerhost, so you can easily save/manage/run powershell scripts from that environment. -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Releases/0_CreateReleaseContainer.ps1: -------------------------------------------------------------------------------- 1 | 2 | . '.\_Settings.ps1' 3 | 4 | $ContainerAlwaysPull = $true 5 | $enableSymbolLoading = $false 6 | $assignPremiumPlan = $false 7 | $includeTestToolkit = $false 8 | $includeTestLibrariesOnly = $false 9 | $InstallDependentModules = $true 10 | 11 | New-NavContainer ` 12 | -containerName $ContainerName ` 13 | -imageName $ContainerImage ` 14 | -accept_eula ` 15 | -additionalParameters $ContainerAdditionalParameters ` 16 | -licenseFile $SecretSettings.containerLicenseFile ` 17 | -alwaysPull:$ContainerAlwaysPull ` 18 | -Credential $ContainerCredentials ` 19 | -doNotExportObjectsToText ` 20 | -updateHosts ` 21 | -auth NavUserPassword ` 22 | -includeCSide ` 23 | -enableSymbolLoading:$enableSymbolLoading ` 24 | -assignPremiumPlan:$assignPremiumPlan ` 25 | -useBestContainerOS ` 26 | -includeTestToolkit:$includeTestToolkit ` 27 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 28 | -Verbose ` 29 | -memoryLimit 4G 30 | 31 | 32 | 33 | if ($InstallDependentModules) { 34 | Install-NCHDependentModules ` 35 | -ContainerName $ContainerName ` 36 | -ContainerModulesOnly 37 | } -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Releases/_Settings.ps1: -------------------------------------------------------------------------------- 1 | #Example of settings for when your dockerhost is installed on a local VM 2 | $SecretSettings = Get-ObjectFromJSON (Join-Path $PSScriptRoot "_SecretSettings.json") #Secret Settings, stored in a .json file, and ignored by git 3 | 4 | #In one Dictionary, to be able to easily pass it to remote servers 5 | $ReleaseSettings = @{} 6 | 7 | #ContainerSettings 8 | $ContainerName = 'Upgrade' 9 | $ContainerUserName = 'waldo' 10 | $ContainerPassword = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 11 | $ContainerCredentials = New-Object System.Management.Automation.PSCredential ($ContainerUserName, $ContainerPassword) 12 | $ContainerImage = 'mcr.microsoft.com/businesscentral/onprem:be' 13 | $ContainerLicenseFile = $SecretSettings.containerLicenseFile 14 | $ContainerAdditionalParameters = @("--env isBcSandbox=Y", "--cpu-count 8", "--dns=8.8.8.8") 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/RunTests/ImportPSTestTool.ps1: -------------------------------------------------------------------------------- 1 | $fobfile = Join-Path $env:TEMP "PSTestTool.fob" 2 | 3 | Download-File ` 4 | -sourceUrl "https://aka.ms/pstesttoolfob" ` 5 | -destinationFile $fobfile 6 | 7 | Import-ObjectsToNavContainer ` 8 | -containerName $containerName ` 9 | -objectsFile $fobfile ` 10 | -sqlCredential $credential 11 | 12 | 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/RunTests/NewContainer.ps1: -------------------------------------------------------------------------------- 1 | $imageName = "mcr.microsoft.com/businesscentral/onprem:w1" 2 | $credential = New-Object pscredential 'waldo', (ConvertTo-SecureString -String 'Waldo1234' -AsPlainText -Force) 3 | $containerName = "bconprem" 4 | New-NavContainer ` 5 | -imageName $imageName ` 6 | -containerName $containerName ` 7 | -accept_eula ` 8 | -updateHosts ` 9 | -auth NavUserPassword ` 10 | -Credential $credential ` 11 | -includeCSide ` 12 | -enableSymbolLoading ` 13 | -includeTestToolkit ` 14 | -licenseFile "C:\ProgramData\NavContainerHelper\license.flf" -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/RunTests/RunTests.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '..\_Settings.ps1') 2 | 3 | Run-TestsInNavContainer ` 4 | -containerName "bconprem" ` 5 | -credential $ContainerCredential ` 6 | -testSuite 'DEFAULT' ` 7 | -XUnitResultFileName 'c:\programdata\navcontainerhelper\bconprem.tests.results.xml' ` 8 | -azuredevops error ` 9 | -verbose -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/SetupBCSandbox.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bcsandbox' 4 | 5 | $ContainerDockerImage = 'mcr.microsoft.com/businesscentral/sandbox:dk' 6 | 7 | #$SecretSettings.containerLicenseFile = "$env:USERPROFILE\Dropbox (Personal)\Dynamics NAV\Licenses\5230132_iFACTO_D365 BUSINESS CENTRAL ON PREMISES_2019 04 08.flf" 8 | 9 | $ContainerAlwaysPull = $true 10 | $enableSymbolLoading = $false 11 | $assignPremiumPlan = $false 12 | $includeTestToolkit = $true 13 | $includeTestLibrariesOnly = $true 14 | 15 | New-NavContainer ` 16 | -containerName $ContainerName ` 17 | -imageName $ContainerDockerImage ` 18 | -accept_eula ` 19 | -additionalParameters $ContainerAdditionalParameters ` 20 | -licenseFile $SecretSettings.containerLicenseFile ` 21 | -alwaysPull:$ContainerAlwaysPull ` 22 | -Credential $ContainerCredential ` 23 | -doNotExportObjectsToText ` 24 | -updateHosts ` 25 | -auth NavUserPassword ` 26 | -enableSymbolLoading:$enableSymbolLoading ` 27 | -assignPremiumPlan:$assignPremiumPlan ` 28 | -includeTestToolkit:$includeTestToolkit ` 29 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 30 | -Verbose ` 31 | -memoryLimit 8G ` 32 | -accept_outdated ` 33 | -includeAL -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Upgrades/0_CreateUpgradeContainer.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | $ContainerAlwaysPull = $false 4 | $enableSymbolLoading = $false 5 | $assignPremiumPlan = $false 6 | $includeTestToolkit = $false 7 | $includeTestLibrariesOnly = $false 8 | $InstallDependentModules = $true 9 | 10 | New-NavContainer ` 11 | -containerName $ContainerName ` 12 | -imageName $ContainerImage ` 13 | -accept_eula ` 14 | -additionalParameters $ContainerAdditionalParameters ` 15 | -licenseFile $SecretSettings.containerLicenseFile ` 16 | -alwaysPull:$ContainerAlwaysPull ` 17 | -Credential $ContainerCredentials ` 18 | -doNotExportObjectsToText ` 19 | -updateHosts ` 20 | -auth NavUserPassword ` 21 | -includeCSide ` 22 | -enableSymbolLoading:$enableSymbolLoading ` 23 | -assignPremiumPlan:$assignPremiumPlan ` 24 | -useBestContainerOS ` 25 | -includeTestToolkit:$includeTestToolkit ` 26 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 27 | -Verbose ` 28 | -memoryLimit 4G 29 | 30 | 31 | 32 | if ($InstallDependentModules) { 33 | Install-NCHDependentModules ` 34 | -ContainerName $ContainerName ` 35 | -ContainerModulesOnly 36 | } -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Upgrades/2_UpgradeDatabaseWithDocker.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | start $UpgradeSettings.UpgradeFolder 4 | 5 | chcp 850 6 | 7 | Merge-NCHNAVApplicationObjects ` 8 | -ContainerName $ContainerName ` 9 | -UpgradeSettings $UpgradeSettings -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Upgrades/4_CopyLanguagesToResultFolderForUpdatingGit.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | Invoke-Command -ComputerName $DockerHost -Credential $DockerHostCredentials -UseSSL:$DockerHostUseSSL -SessionOption $DockerHostSessionOption -ScriptBlock { 4 | param( 5 | $UpgradeSettings, $ContainerName 6 | ) 7 | 8 | Invoke-Command -Session (Get-NavContainerSession -containerName $ContainerName) -ScriptBlock { 9 | param( 10 | $UpgradeSettings 11 | ) 12 | 13 | $ResultWithLanguages = Join-Path $UpgradeSettings.ResultFolder "ResultWithLanguages" 14 | 15 | Write-Host "From: $($ResultWithLanguages)\*.txt" 16 | Write-Host "To: $(Join-Path $UpgradeSettings.ResultFolder "MergeResult")" 17 | 18 | Copy-Item -Path "$ResultWithLanguages\*.txt" -Destination (Join-Path $UpgradeSettings.ResultFolder "MergeResult") -Recurse 19 | 20 | } -ArgumentList $UpgradeSettings 21 | 22 | } -ArgumentList $UpgradeSettings, $ContainerName 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Upgrades/5_JoinToResultFile.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | $FolderToJoin = "C:\ProgramData\NavContainerHelper\Upgrades\DistriCU3_Result_Fixed\MergeResult" 4 | 5 | Invoke-ScriptInNavContainer -containerName $ContainerName -ScriptBlock { 6 | param( 7 | $FolderToJoin 8 | ) 9 | 10 | $FinalResult = "$FolderToJoin.txt" 11 | Join-NAVApplicationObjectFile -Source $FolderToJoin -Destination $FinalResult 12 | 13 | 14 | } -ArgumentList $FolderToJoin 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/Upgrades/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Als this directory is for scripts that are basically using the functions in my module CRS.RemoteNAVDockerHostHelper 3 | 4 | # Upgrades 5 | Docker is very interesting to be used in upgrade-scenarios. in this folders, there are a number of scripts to perform an upgrade by using a Docker Container that are hosted on a remote server that has docker installed (A remote Docker Host) -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_CleanApp.ps1: -------------------------------------------------------------------------------- 1 | 2 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 3 | 4 | $Containername = 'bccurrent' 5 | 6 | Clean-NCHCustomNAVApps -ContainerName $Containername 7 | 8 | Get-NCHCustomNAVApps -ContainerName $Containername -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_CreateSuperUser.ps1: -------------------------------------------------------------------------------- 1 | $ContainerName = 'bccurrent' 2 | 3 | $UID = 'admin' 4 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 5 | 6 | New-NCHNAVSuperUser -ContainerName $ContainerName -Username $UID -Password $Password -CreateWebServicesKey -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_ExportObjectLanguage.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bconprem' 4 | $ObjectFile = "C:\temp\13.0.24630.0-de.txt" 5 | $Path = 'C:\Temp\' 6 | $language = 'DEU' 7 | $Encoding = 'OEM' 8 | 9 | $ObjectFileOnContainer = Join-Path "C:\ProgramData\navcontainerhelper\Extensions\$Containername" (Get-Item $ObjectFile).Name 10 | Copy-Item -Path $ObjectFile -Destination $ObjectFileOnContainer -Force 11 | 12 | # $Containersession = Get-NavContainerSession -containerName $Containername 13 | # Invoke-Command -Session $Containersession { 14 | Invoke-ScriptInNavContainer -ContainerName $ContainerName -scriptblock { 15 | 16 | param($Containername, $ObjectFileOnContainer, $language, $Encoding) 17 | 18 | Export-NAVApplicationObjectLanguage ` 19 | -Source $ObjectFileOnContainer ` 20 | -Destination (Join-Path "C:\ProgramData\navcontainerhelper\Extensions\$Containername" "$language.txt") ` 21 | -Language $language ` 22 | -Encoding $Encoding 23 | 24 | } -ArgumentList $Containername, $ObjectFileOnContainer, $language, $Encoding 25 | 26 | Copy-Item -Path (Join-Path "C:\ProgramData\navcontainerhelper\Extensions\$Containername" "$language.txt") -Destination (Join-Path $Path "$language.txt") 27 | 28 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_ExportObjects.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'navserver' 4 | $Path = 'C:\Temp\' 5 | $filter = 'Id=3' 6 | 7 | 8 | $Result = Export-NCHNAVApplicationObjects ` 9 | -ContainerName $Containername ` 10 | -filter $filter 11 | 12 | 13 | move-item -Path $Result -Destination (Join-Path -Path $Path -ChildPath ([io.path]::getFilename($result))) -Force 14 | 15 | start $Path 16 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_ExportObjectsAsAL.ps1: -------------------------------------------------------------------------------- 1 | #. (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $containerName = 'bccurrent' 4 | $extensionStartId = '50001' 5 | $Path = 'C:\temp\AL' 6 | $filter = 'Id="42|46|43|47|6630|6631|50|54|51|55|49|97|67|66"' 7 | # $filter = "Id=11315" 8 | # $filter = 'Id="507|9303|509|9310"' 9 | $filter = 'Id="134332|134338|137212"' 10 | 11 | $result = Export-NCHNAVApplicationObjectsAsAL ` 12 | -ContainerName $containerName ` 13 | -filter $filter ` 14 | -extensionStartId $extensionStartId ` 15 | -DestinationPath $Path 16 | 17 | # Get-ChildItem "C:\ProgramData\navcontainerhelper\Extensions\$containerName\Export-NAVALfromNAVApplicationObject\AL" | 18 | # Move-Item -Destination $Path -Force 19 | 20 | start $Path 21 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_ImportTestRunner.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $TestTool = "C:\ProgramData\NavContainerHelper\PS Test Tool.fob" 4 | 5 | Import-NAVApplicationObject2 -Path $TestTool -ServerInstance NAV -LogPath "C:\ProgramData\navcontainerhelper" -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_InstallApp.ps1: -------------------------------------------------------------------------------- 1 | $AppFile = get-item "C:\Users\ericw\Documents\AL\ALProject26\Default publisher_ALProject26_1.0.0.0.app" 2 | $AppFile = get-item "C:\Users\ericw\Documents\AL\ALProject27\Default publisher_ALProject27_1.0.0.0.app" 3 | $ContainerName = 'bcdaily' 4 | 5 | #Script 6 | $DestinationInContainer = Join-Path "C:\ProgramData\NavContainerHelper" $AppFile.Name 7 | $AppFile | Copy-Item -Destination $DestinationInContainer 8 | 9 | Install-NCHNavApp ` 10 | -ContainerName $ContainerName ` 11 | -Path $DestinationInContainer ` 12 | -DoNotDeleteAppFile:$true 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_PrepDockerHost.ps1: -------------------------------------------------------------------------------- 1 | 2 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 3 | 4 | $null = Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force 5 | 6 | #navcontainerhelper 7 | $FindModule = Find-Module 'navcontainerhelper' 8 | if($FindModule){ 9 | write-host -Object " Installing $($FindModule.Name) version $($FindModule.Version) on Docker Host." -ForegroundColor Gray 10 | Install-Module 'navcontainerhelper' -Force 11 | } 12 | 13 | #CRS.NavContainerHelperExtension 14 | $FindModule = Find-Module 'CRS.NavContainerHelperExtension' 15 | if($FindModule){ 16 | write-host -Object " Installing $($FindModule.Name) version $($FindModule.Version) on Docker Host." -ForegroundColor Gray 17 | Install-Module 'CRS.NavContainerHelperExtension' -Force 18 | } 19 | 20 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_RemoveContainer.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bccurrent' 4 | 5 | Remove-NavContainer -Containername $Containername -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_Settings.ps1: -------------------------------------------------------------------------------- 1 | #Example of settings for when your dockerhost is installed on a local VM 2 | $SecretSettings = Get-ObjectFromJSON (Join-Path $PSScriptRoot "_SecretSettings.json") #Secret Settings, stored in a .json file, and ignored by git 3 | 4 | $UserName = 'waldo' 5 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 6 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 7 | 8 | $UserName = 'sa' 9 | $ContainerSqlCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 10 | 11 | #$ContainerAdditionalParameters = @("--env isBcSandbox=Y","--cpu-count 8","--dns=8.8.8.8") 12 | $ContainerAdditionalParameters = @("--cpu-count 8", "--dns=8.8.8.8") 13 | 14 | #Just to update the modules to my local latest uncommitted version to be able to test them 15 | #import-module "$env:USERPROFILE\Dropbox\GitHub\Cloud.Ready.Software.PowerShell\PSModules\CRS.RemoteNAVDockerHostHelper\CRS.RemoteNAVDockerHostHelper.psm1" -Force -WarningAction SilentlyContinue 16 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker/_UpdateApp.ps1: -------------------------------------------------------------------------------- 1 | $AppFile = get-item "C:\Users\ericw\Documents\AL\ALProject26\Default publisher_ALProject26_1.0.0.1.app" 2 | $ContainerName = 'bcdaily' 3 | 4 | #Script 5 | $DestinationInContainer = Join-Path "C:\ProgramData\NavContainerHelper" $AppFile.Name 6 | $AppFile | Copy-Item -Destination $DestinationInContainer 7 | 8 | Upgrade-NCHNAVApp ` 9 | -ContainerName $ContainerName ` 10 | -Path $DestinationInContainer 11 | 12 | 13 | # Publish-BCContainerApp ` 14 | # -containerName $ContainerName ` 15 | # -appFile $AppFile ` 16 | # -skipVerification ` 17 | 18 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/CreateImage.ps1: -------------------------------------------------------------------------------- 1 | $artifactUrl = "https://bcartifacts.azureedge.net/onprem/" 2 | $imageName = "waldo:something" 3 | 4 | if (-not (Get-BcContainerGenericTag -containerOrImageName $imageName -ErrorAction SilentlyContinue)) { 5 | New-Bcimage -artifactUrl $artifactUrl -imageName $imagename 6 | } 7 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/PerfTest/RunBCPTTest.ps1: -------------------------------------------------------------------------------- 1 | $UserName = 'waldo' 2 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 3 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 4 | 5 | Run-BCPTTestsInBcContainer ` 6 | -containerName PerfTest ` 7 | -credential $ContainerCredential ` 8 | -testPage 149002 ` 9 | -suiteCode 'TEST' 10 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/PerfTest/RunBCPTTest2.ps1: -------------------------------------------------------------------------------- 1 | $UserName = 'waldo' 2 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 3 | $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 4 | 5 | $Version = (Get-ChildItem "C:\bcartifacts.cache\sandbox\" | where Name -like "*23.0*" | sort Name -Descending | select Name -First 1).Name 6 | Set-Location "C:\bcartifacts.cache\sandbox\$Version\platform\Applications\testframework\TestRunner" 7 | 8 | ./RunBCPTTests.ps1 ` 9 | -Environment OnPrem ` 10 | -AuthorizationType NavUserPassword ` 11 | -Credential $Credential ` 12 | -TestRunnerPage 149002 ` 13 | -SuiteCode "TEST" ` 14 | -ServiceUrl 'http://PerfTest/BC' ` 15 | -BCPTTestRunnerInternalFolderPath './internal' 16 | 17 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/SetupBCDEV1.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $artifactUrl = Get-BCArtifactUrl ` 4 | -Type OnPrem ` 5 | -Select Latest ` 6 | -country be 7 | 8 | $ContainerName = 'bcdev1' 9 | $ImageName = $ContainerName 10 | 11 | $includeTestToolkit = $true 12 | $includeTestLibrariesOnly = $true 13 | 14 | $StartMs = Get-date 15 | 16 | New-BcContainer ` 17 | -accept_eula ` 18 | -containerName $ContainerName ` 19 | -artifactUrl $artifactUrl ` 20 | -imageName $imageName ` 21 | -Credential $ContainerCredential ` 22 | -auth "UserPassword" ` 23 | -updateHosts ` 24 | -alwaysPull ` 25 | -includeTestToolkit:$includeTestToolkit ` 26 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 27 | -licenseFile $SecretSettings.containerLicenseFile 28 | 29 | $EndMs = Get-date 30 | Write-host "This script took $(($EndMs - $StartMs).TotalSeconds) seconds to run" 31 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/SetupBCDEV2.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $artifactUrl = Get-BCArtifactUrl ` 4 | -Type OnPrem ` 5 | -Select Latest ` 6 | -country be 7 | 8 | $ContainerName = 'bcdev2' 9 | $ImageName = $ContainerName 10 | 11 | $includeTestToolkit = $true 12 | $includeTestLibrariesOnly = $true 13 | 14 | $StartMs = Get-date 15 | 16 | New-BcContainer ` 17 | -accept_eula ` 18 | -containerName $ContainerName ` 19 | -artifactUrl $artifactUrl ` 20 | -imageName $imageName ` 21 | -Credential $ContainerCredential ` 22 | -auth "UserPassword" ` 23 | -updateHosts ` 24 | -alwaysPull ` 25 | -includeTestToolkit:$includeTestToolkit ` 26 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 27 | -licenseFile $SecretSettings.containerLicenseFile 28 | 29 | $EndMs = Get-date 30 | Write-host "This script took $(($EndMs - $StartMs).TotalSeconds) seconds to run" 31 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/SetupBCNext.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $artifactUrl = Get-BCArtifactUrl ` 4 | -type Sandbox ` 5 | -sasToken $SecretSettings.InsiderSASToken ` 6 | -select NextMinor ` 7 | -country base 8 | 9 | $ContainerName = 'bcnext' 10 | $ImageName = $ContainerName 11 | 12 | $includeTestToolkit = $true 13 | $includeTestLibrariesOnly = $true 14 | 15 | $StartMs = Get-date 16 | 17 | New-BcContainer ` 18 | -accept_eula ` 19 | -containerName $ContainerName ` 20 | -artifactUrl $artifactUrl ` 21 | -imageName $imageName ` 22 | -Credential $ContainerCredential ` 23 | -auth "UserPassword" ` 24 | -updateHosts ` 25 | -alwaysPull ` 26 | -includeTestToolkit:$includeTestToolkit ` 27 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 28 | -licenseFile $SecretSettings.containerLicenseFile ` 29 | -includeTestFrameworkOnly 30 | 31 | $EndMs = Get-date 32 | Write-host "This script took $(($EndMs - $StartMs).TotalSeconds) seconds to run" 33 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/SetupBCPublicPreview.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $artifactUrl = Get-BCArtifactUrl ` 4 | -country be ` 5 | -storageAccount bcpublicpreview ` 6 | -select Latest 7 | 8 | $ContainerName = 'bcpublicreview' 9 | $ImageName = $ContainerName 10 | 11 | $includeTestToolkit = $true 12 | $includeTestLibrariesOnly = $true 13 | 14 | $StartMs = Get-date 15 | 16 | New-BcContainer ` 17 | -accept_eula ` 18 | -containerName $ContainerName ` 19 | -artifactUrl $artifactUrl ` 20 | -imageName $imageName ` 21 | -Credential $ContainerCredential ` 22 | -auth "UserPassword" ` 23 | -updateHosts ` 24 | -alwaysPull ` 25 | -includeTestToolkit:$includeTestToolkit ` 26 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 27 | -licenseFile $SecretSettings.containerLicenseFile 28 | 29 | $EndMs = Get-date 30 | Write-host "This script took $(($EndMs - $StartMs).TotalSeconds) seconds to run" 31 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/SetupBCiFacto.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $ContainerName = 'bcifacto' 4 | $imageName = 'dtr.ifacto.be/distri:onprem-18.0.23013.23795-be-ltsc2019' 5 | 6 | $includeTestToolkit = $false 7 | $includeTestLibrariesOnly = $false 8 | 9 | $StartMs = Get-date 10 | 11 | New-BcContainer ` 12 | -accept_eula ` 13 | -containerName $ContainerName ` 14 | -imageName $imageName ` 15 | -Credential $ContainerCredential ` 16 | -auth "UserPassword" ` 17 | -updateHosts ` 18 | -alwaysPull ` 19 | -includeTestToolkit:$includeTestToolkit ` 20 | -includeTestLibrariesOnly:$includeTestLibrariesOnly ` 21 | -licenseFile $SecretSettings.containerLicenseFile 22 | 23 | 24 | $EndMs = Get-date 25 | Write-host "This script took $(($EndMs - $StartMs).TotalSeconds) seconds to run" 26 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/_FirstScript.ps1: -------------------------------------------------------------------------------- 1 | $artifactUrl = "https://bcartifacts.azureedge.net/businesscentral/onprem/2004-cu2-be" 2 | 3 | $credential = New-Object pscredential 'waldo', (ConvertTo-SecureString -String 'Waldo1234' -AsPlainText -Force) 4 | New-BcContainer ` 5 | -accept_eula ` 6 | -artifactUrl $artifactUrl ` 7 | -containerName "test" ` 8 | -auth "UserPassword" ` 9 | -Credential $credential ` 10 | -updateHosts 11 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/LocalDocker2/_Prep.ps1: -------------------------------------------------------------------------------- 1 | install-module az -force 2 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/CleanApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'devpreview' 4 | 5 | Clean-RDHCustomNAVApps ` 6 | -DockerHost $DockerHost ` 7 | -DockerHostCredentials $DockerHostCredentials ` 8 | -DockerHostUseSSL:$DockerHostUseSSL ` 9 | -DockerHostSessionOption $DockerHostSessionOption ` 10 | -ContainerName $Containername ` 11 | -Verbose 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/EnterDockerHost.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | Enter-PSSession ` 4 | -ComputerName $DockerHost ` 5 | -Credential $DockerHostCredentials ` 6 | -UseSSL:$DockerHostUseSSL ` 7 | -SessionOption $DockerHostSessionOption -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/InstallApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'devpreview' 4 | $Appfilename = 'C:\Users\ericw\Dropbox\Cloud Ready Software\Projects\Microsoft\HDI Videos\waldo\HDI add upgrade logic to an extension\Apps\Books\Cloud Ready Software GmbH_BookShelf_1.0.0.0.app' 5 | 6 | <# 7 | 8 | Sync-RDHNAVTenant ` 9 | -DockerHost $DockerHost ` 10 | -DockerHostCredentials $DockerHostCredentials ` 11 | -DockerHostUseSSL:$DockerHostUseSSL ` 12 | -DockerHostSessionOption $DockerHostSessionOption ` 13 | -ContainerName $Containername 14 | 15 | #> 16 | 17 | Install-RDHNAVApp ` 18 | -DockerHost $DockerHost ` 19 | -DockerHostCredentials $DockerHostCredentials ` 20 | -DockerHostUseSSL:$DockerHostUseSSL ` 21 | -DockerHostSessionOption $DockerHostSessionOption ` 22 | -ContainerName $Containername ` 23 | -AppFileName $Appfilename ` 24 | -Verbose -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/SetupDevPreview.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $ContainerDockerImage = 'microsoft/dynamics-nav:devpreview' 4 | $Containername = 'devpreview' 5 | 6 | $UserName = 'waldo' 7 | $Password = ConvertTo-SecureString 'waldo1234' -AsPlainText -Force 8 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 9 | 10 | New-RDHNAVContainer ` 11 | -DockerHost $DockerHost ` 12 | -DockerHostCredentials $DockerHostCredentials ` 13 | -DockerHostUseSSL:$DockerHostUseSSL ` 14 | -DockerHostSessionOption $DockerHostSessionOption ` 15 | -ContainerDockerImage $ContainerDockerImage ` 16 | -ContainerName $Containername ` 17 | -ContainerLicenseFile $ContainerLicenseFile ` 18 | -ContainerCredential $ContainerCredential ` 19 | -ContainerAlwaysPull ` 20 | -ContainerAdditionalParameters $ContainerAdditionalParameters 21 | 22 | Install-RDHDependentModules ` 23 | -DockerHost $DockerHost ` 24 | -DockerHostCredentials $DockerHostCredentials ` 25 | -DockerHostUseSSL:$DockerHostUseSSL ` 26 | -DockerHostSessionOption $DockerHostSessionOption ` 27 | -ContainerName $Containername 28 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/UpgradeApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'devpreview' 4 | $Appfilename = 'C:\Users\Waldo\Dropbox\Cloud Ready Software\Projects\Microsoft\HDI Videos\waldo\HDI add upgrade logic to an extension\Apps\Books\Cloud Ready Software GmbH_BookShelf_1.0.0.0.app' 5 | 6 | Upgrade-RDHNAVApp ` 7 | -DockerHost $DockerHost ` 8 | -DockerHostCredentials $DockerHostCredentials ` 9 | -DockerHostUseSSL:$DockerHostUseSSL ` 10 | -DockerHostSessionOption $DockerHostSessionOption ` 11 | -ContainerName $Containername ` 12 | -AppFileName $Appfilename ` 13 | -Verbose -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/AzureVM/_Settings.ps1: -------------------------------------------------------------------------------- 1 | #Example of settings for Azure VM 2 | 3 | $SecretSettings = Get-ObjectFromJSON (Join-Path $PSScriptRoot "_SecretSettings.json") #Secret Settings, stored in a .json file, and ignored by git 4 | 5 | $DockerHost = 'waldops.westeurope.cloudapp.azure.com' 6 | $DockerHostUseSSL = $true 7 | $DockerHostSessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck 8 | 9 | $UserName = 'vmadmin' 10 | $Password = ConvertTo-SecureString $SecretSettings.password -AsPlainText -Force 11 | $DockerHostCredentials = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 12 | 13 | $ContainerLicenseFile = $SecretSettings.containerLicenseFile 14 | $ContainerAdditionalParameters = @() 15 | 16 | #Just to update the modules to my local latest uncommitted version to be able to test them 17 | import-module "$env:USERPROFILE\Dropbox\GitHub\Cloud.Ready.Software.PowerShell\PSModules\CRS.RemoteNAVDockerHostHelper\CRS.RemoteNAVDockerHostHelper.psm1" -Force -WarningAction SilentlyContinue 18 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/CreateNetworkShare.ps1: -------------------------------------------------------------------------------- 1 | New-SmbShare -Name "navcontainerhelper" ` 2 | -Path "C:\ProgramData\NavContainerHelper" ` 3 | -FullAccess 'WIN-JMG5L691804\Administrator' -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Basically uses the CRS.RemoteNAVDockerHostHelper 3 | 4 | # Scenario 5 | You usuall work locally on your windows 10 environment, and you have a remote VM (e.g. A Hyper-V running on your system, or a VM on Azure with a running DockerHost) that has Docker installed, and is running NAV containers. You want to easily do specific tasks from your local environment on that remote docker environment. -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/ReleaseOnWaldoCoreVM/0_SetupPSDevEnv.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | New-RDHNAVContainer ` 4 | -DockerHost $DockerHost ` 5 | -DockerHostCredentials $DockerHostCredentials ` 6 | -DockerHostUseSSL:$DockerHostUseSSL ` 7 | -DockerHostSessionOption $DockerHostSessionOption ` 8 | -ContainerDockerImage $ContainerImage ` 9 | -ContainerName $Containername ` 10 | -ContainerLicenseFile $ContainerLicenseFile ` 11 | -ContainerCredential $ContainerCredential ` 12 | -ContainerAlwaysPull ` 13 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 14 | -donotexportobjects 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/ReleaseOnWaldoCoreVM/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Als this directory is for scripts that are basically using the functions in my module CRS.RemoteNAVDockerHostHelper 3 | 4 | # Upgrades 5 | In this folders, there are a number of scripts to perform a release by using a Docker Container that are hosted on a remote server that has docker installed (A remote Docker Host) -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/ReleaseOnWaldoCoreVM/_EnterContainer.ps1: -------------------------------------------------------------------------------- 1 | #Execute Set-By-Step 2 | Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass 3 | . '.\_Settings.ps1' 4 | 5 | Enter-PSSession -ComputerName $DockerHost -Credential $DockerHostCredentials 6 | break 7 | Enter-NavContainer -containerName 'psdevenv' 8 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/0_CreateUpgradeContainer.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | New-RDHNAVContainer ` 4 | -DockerHost $DockerHost ` 5 | -DockerHostCredentials $DockerHostCredentials ` 6 | -DockerHostUseSSL:$DockerHostUseSSL ` 7 | -DockerHostSessionOption $DockerHostSessionOption ` 8 | -ContainerName $ContainerName ` 9 | -ContainerDockerImage $ContainerImage ` 10 | -ContainerLicenseFile $ContainerLicenseFile ` 11 | -ContainerAdditionalParameters @("--network=tlan","--ip $ContainerIP") ` 12 | -ContainerCredential $ContainerCredentials ` 13 | -ContainerAlwaysPull ` 14 | -doNotExportObjectsToText 15 | 16 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/2_UpgradeDatabaseWithDocker.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | Start "\\172.21.31.2\NavContainerHelper" 4 | 5 | Merge-RDHNAVApplicationObjects ` 6 | -DockerHost $DockerHost ` 7 | -DockerHostCredentials $DockerHostCredentials ` 8 | -DockerHostUseSSL:$DockerHostUseSSL ` 9 | -DockerHostSessionOption $DockerHostSessionOption ` 10 | -ContainerName $ContainerName ` 11 | -UpgradeSettings $UpgradeSettings 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/4_CopyLanguagesToResultFolderForUpdatingGit.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | Invoke-Command -ComputerName $DockerHost -Credential $DockerHostCredentials -UseSSL:$DockerHostUseSSL -SessionOption $DockerHostSessionOption -ScriptBlock { 4 | param( 5 | $UpgradeSettings, $ContainerName 6 | ) 7 | 8 | Invoke-Command -Session (Get-NavContainerSession -containerName $ContainerName) -ScriptBlock { 9 | param( 10 | $UpgradeSettings 11 | ) 12 | 13 | $ResultWithLanguages = Join-Path $UpgradeSettings.ResultFolder "ResultWithLanguages" 14 | 15 | Write-Host "From: $($ResultWithLanguages)\*.txt" 16 | Write-Host "To: $(Join-Path $UpgradeSettings.ResultFolder "MergeResult")" 17 | 18 | Copy-Item -Path "$ResultWithLanguages\*.txt" -Destination (Join-Path $UpgradeSettings.ResultFolder "MergeResult") -Recurse 19 | 20 | } -ArgumentList $UpgradeSettings 21 | 22 | } -ArgumentList $UpgradeSettings, $ContainerName 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/5_JoinToResultFile.ps1: -------------------------------------------------------------------------------- 1 | . '.\_Settings.ps1' 2 | 3 | Invoke-Command -ComputerName $DockerHost -Credential $DockerHostCredentials -UseSSL:$DockerHostUseSSL -SessionOption $DockerHostSessionOption -ScriptBlock { 4 | param( 5 | $UpgradeSettings, $ContainerName 6 | ) 7 | 8 | Invoke-Command -Session (Get-NavContainerSession -containerName $ContainerName) -ScriptBlock { 9 | param( 10 | $UpgradeSettings 11 | ) 12 | 13 | $FinalResult = Join-path $UpgradeSettings.ResultFolder "FinalResult.txt" 14 | Join-NAVApplicationObjectFile -Source (Join-Path $UpgradeSettings.ResultFolder "MergeResult") -Destination $FinalResult 15 | 16 | 17 | } -ArgumentList $UpgradeSettings 18 | 19 | } -ArgumentList $UpgradeSettings, $ContainerName 20 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | Als this directory is for scripts that are basically using the functions in my module CRS.RemoteNAVDockerHostHelper 3 | 4 | # Upgrades 5 | Docker is very interesting to be used in upgrade-scenarios. in this folders, there are a number of scripts to perform an upgrade by using a Docker Container that are hosted on a remote server that has docker installed (A remote Docker Host) -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/_EnterContainer.ps1: -------------------------------------------------------------------------------- 1 | #Execute Set-By-Step 2 | Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass 3 | . '.\_Settings.ps1' 4 | 5 | Enter-PSSession -ComputerName $DockerHost -Credential $DockerHostCredentials 6 | break 7 | Enter-NavContainer -containerName 'Upgrade' 8 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/UpgradesOnWaldoCoreVM/_PrepDockerHost.ps1: -------------------------------------------------------------------------------- 1 | 2 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 3 | 4 | Install-RDHDependentModules ` 5 | -DockerHost $DockerHost ` 6 | -DockerHostCredentials $DockerHostCredentials ` 7 | -DockerHostUseSSL:$DockerHostUseSSL ` 8 | -DockerHostSessionOption $DockerHostSessionOption -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/EnterDockerHost.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | Enter-PSSession ` 4 | -ComputerName $DockerHost ` 5 | -Credential $DockerHostCredentials ` 6 | -UseSSL:$DockerHostUseSSL ` 7 | -SessionOption $DockerHostSessionOption 8 | 9 | break 10 | 11 | Enter-NavContainer -ContainerName psdevenv 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/ImportModule.ps1: -------------------------------------------------------------------------------- 1 | #In the container 2 | 3 | Import-Module CRS.NavContainerHelperExtension -Force -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/RemoveModulesFromDockerHost.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $session = New-PSSession ` 4 | -ComputerName $DockerHost ` 5 | -Credential $DockerHostCredentials ` 6 | -UseSSL:$DockerHostUseSSL ` 7 | -SessionOption $DockerHostSessionOption 8 | 9 | Invoke-Command -Session $session -ScriptBlock { 10 | Remove-Item -Path 'C:\Program Files\WindowsPowerShell\Modules\CRS.NavContainerHelperExtension' -Force -Recurse 11 | } 12 | 13 | Remove-PSSession -Session $session -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/SetupPSDevEnv.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $UserName = 'waldo' 4 | $Password = ConvertTo-SecureString 'Waldo1234' -AsPlainText -Force 5 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 6 | 7 | New-RDHNAVContainer ` 8 | -DockerHost $DockerHost ` 9 | -DockerHostCredentials $DockerHostCredentials ` 10 | -DockerHostUseSSL:$DockerHostUseSSL ` 11 | -DockerHostSessionOption $DockerHostSessionOption ` 12 | -ContainerDockerImage $ContainerDockerImage ` 13 | -ContainerName $Containername ` 14 | -ContainerLicenseFile $ContainerLicenseFile ` 15 | -ContainerCredential $ContainerCredential ` 16 | -ContainerAlwaysPull ` 17 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 18 | -donotexportobjects 19 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/UpdateModulesOnDockerHost.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $ModulePath = "$env:USERPROFILE\dropbox\github\Cloud.Ready.Software.PowerShell\PSModules\CRS.NavContainerHelperExtension" 4 | 5 | $cs = New-PSSession -ComputerName $DockerHost -UseSSL:$DockerHostUseSSL -Credential $DockerHostCredentials -SessionOption $DockerHostSessionOption 6 | 7 | Get-ChildItem $ModulePath | %{ 8 | Copy-Item ` -Path $_.FullName ` -Destination 'C:\Program Files\WindowsPowerShell\Modules\CRS.NavContainerHelperExtension\1.0.2.0' ` -ToSession $cs ` -Force ` -Recurse } Remove-PSSession $cs -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/WaldosModuleDevHelperScripts/_Settings.ps1: -------------------------------------------------------------------------------- 1 | #Example of settings for when your dockerhost is installed on a local VM 2 | $SecretSettings = Get-ObjectFromJSON (Join-Path $PSScriptRoot "_SecretSettings.json") #Secret Settings, stored in a .json file, and ignored by git 3 | 4 | $DockerHost = 'waldocorevm' 5 | $DockerHostUseSSL = $true 6 | $DockerHostSessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck 7 | 8 | $UserName = 'administrator' 9 | $Password = ConvertTo-SecureString $SecretSettings.password -AsPlainText -Force 10 | $DockerHostCredentials = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 11 | 12 | $ContainerDockerImage = 'microsoft/dynamics-nav' 13 | $Containername = 'psdevenv' 14 | $ContainerLicenseFile = $SecretSettings.containerLicenseFile 15 | $ContainerAdditionalParameters = @("--network=tlan") 16 | $ContainerAdditionalParameters += "--ip 172.21.31.6" 17 | 18 | #Just to update the modules to my local latest uncommitted version to be able to test them 19 | import-module "$env:USERPROFILE\Dropbox\GitHub\Cloud.Ready.Software.PowerShell\PSModules\CRS.RemoteNAVDockerHostHelper\CRS.RemoteNAVDockerHostHelper.psm1" -Force -WarningAction SilentlyContinue 20 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/CleanApp.ps1: -------------------------------------------------------------------------------- 1 | 2 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 3 | 4 | $Containername = 'bcdaily' 5 | 6 | 7 | <# Get-RDHCustomNAVApps ` 8 | -DockerHost $DockerHost ` 9 | -DockerHostCredentials $DockerHostCredentials ` 10 | -DockerHostUseSSL:$DockerHostUseSSL ` 11 | -DockerHostSessionOption $DockerHostSessionOption ` 12 | -ContainerName $Containernamein 13 | #> 14 | 15 | Clean-RDHCustomNAVApps ` 16 | -DockerHost $DockerHost ` 17 | -DockerHostCredentials $DockerHostCredentials ` 18 | -DockerHostUseSSL:$DockerHostUseSSL ` 19 | -DockerHostSessionOption $DockerHostSessionOption ` 20 | -ContainerName $Containername 21 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/ConvertApp.ps1: -------------------------------------------------------------------------------- 1 | # Convert a txt-file to al (txt2al.exe) 2 | 3 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 4 | 5 | $TxtFile = 'C:\temp\CWF.txt' 6 | $Containername = 'devpreview' 7 | $startId = 70117820 8 | $objectsFilter = 'Name=CWF*|ERR*' 9 | $localResultFolder = 'C:\Temp\CWF_AL' 10 | 11 | $UserName = 'sa' 12 | $Password = ConvertTo-SecureString 'waldo1234' -AsPlainText -Force 13 | $sqlCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 14 | 15 | $Result = 16 | Convert-RDHTxtToAl ` 17 | -DockerHost $DockerHost ` 18 | -DockerHostCredentials $DockerHostCredentials ` 19 | -DockerHostUseSSL:$DockerHostUseSSL ` 20 | -DockerHostSessionOption $DockerHostSessionOption ` 21 | -ContainerName $Containername ` 22 | -TxtFile $TxtFile ` 23 | -sqlCredential $sqlCredential ` 24 | -startId $startId ` 25 | -objectsFilter $objectsFilter ` 26 | -LocalResultFolder $localResultFolder 27 | 28 | Start (Get-Item $Result).Directory -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/InstallApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'RBA' 4 | $Appfilename = "C:\Users\Waldo\Documents\My Received Files\Cloud Ready Software GmbH_ReceiptBank_1.0.1.1\Cloud Ready Software GmbH_ReceiptBank_1.0.1.1.app" 5 | 6 | Install-RDHNAVApp ` 7 | -DockerHost $DockerHost ` 8 | -DockerHostCredentials $DockerHostCredentials ` 9 | -DockerHostUseSSL:$DockerHostUseSSL ` 10 | -DockerHostSessionOption $DockerHostSessionOption ` 11 | -ContainerName $Containername ` 12 | -AppFileName $Appfilename ` 13 | -Verbose 14 | 15 | Get-RDHCustomNAVApps ` 16 | -DockerHost $DockerHost ` 17 | -DockerHostCredentials $DockerHostCredentials ` 18 | -DockerHostUseSSL:$DockerHostUseSSL ` 19 | -DockerHostSessionOption $DockerHostSessionOption ` 20 | -ContainerName $Containername 21 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupBCCurrent.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bccurrent' 4 | $ContainerAdditionalParameters += "--ip 172.21.31.3" 5 | 6 | $ContainerDockerImage = 'mcr.microsoft.com/businesscentral/sandbox' 7 | $ContainerAlwaysPull = $false 8 | $enableSymbolLoading = $true 9 | #$SecretSettings.containerLicenseFile = 'c:\programdata\navcontainerhelper\NAV2018License.flf' 10 | 11 | New-RDHNAVContainer ` 12 | -DockerHost $DockerHost ` 13 | -DockerHostCredentials $DockerHostCredentials ` 14 | -DockerHostUseSSL:$DockerHostUseSSL ` 15 | -DockerHostSessionOption $DockerHostSessionOption ` 16 | -ContainerDockerImage $ContainerDockerImage ` 17 | -ContainerName $Containername ` 18 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 19 | -ContainerCredential $ContainerCredential ` 20 | -ContainerAlwaysPull:$ContainerAlwaysPull ` 21 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 22 | -doNotExportObjectsToText ` 23 | -enableSymbolLoading:$enableSymbolLoading 24 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupBCMgt.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bcmgt' 4 | $ContainerAdditionalParameters += "--ip 172.21.31.16" 5 | 6 | $ContainerDockerImage = 'mcr.microsoft.com/businesscentral/onprem' 7 | $ContainerAlwaysPull = $false 8 | $enableSymbolLoading = $false 9 | #$SecretSettings.containerLicenseFile = 'c:\programdata\navcontainerhelper\NAV2018License.flf' 10 | 11 | 12 | New-RDHNAVContainer ` 13 | -DockerHost $DockerHost ` 14 | -DockerHostCredentials $DockerHostCredentials ` 15 | -DockerHostUseSSL:$DockerHostUseSSL ` 16 | -DockerHostSessionOption $DockerHostSessionOption ` 17 | -ContainerDockerImage $ContainerDockerImage ` 18 | -ContainerRegistryUserName $SecretSettings.containerRegistryUserName ` 19 | -ContainerRegistryPwd $SecretSettings.containerRegistryPassword ` 20 | -ContainerName $Containername ` 21 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 22 | -ContainerCredential $ContainerCredential ` 23 | -ContainerAlwaysPull:$ContainerAlwaysPull ` 24 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 25 | -doNotExportObjectsToText ` 26 | -enableSymbolLoading:$enableSymbolLoading 27 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupBCNext.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bcnext' 4 | $ContainerAdditionalParameters += "--ip 172.21.31.15" 5 | 6 | $ContainerDockerImage = 'bcinsider.azurecr.io/bcsandbox:us' 7 | $ContainerAlwaysPull = $true 8 | $enableSymbolLoading = $false 9 | #$SecretSettings.containerLicenseFile = 'c:\programdata\navcontainerhelper\NAV2018License.flf' 10 | 11 | 12 | New-RDHNAVContainer ` 13 | -DockerHost $DockerHost ` 14 | -DockerHostCredentials $DockerHostCredentials ` 15 | -DockerHostUseSSL:$DockerHostUseSSL ` 16 | -DockerHostSessionOption $DockerHostSessionOption ` 17 | -ContainerDockerImage $ContainerDockerImage ` 18 | -ContainerRegistryUserName $SecretSettings.containerRegistryUserName ` 19 | -ContainerRegistryPwd $SecretSettings.containerRegistryPassword ` 20 | -ContainerName $Containername ` 21 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 22 | -ContainerCredential $ContainerCredential ` 23 | -ContainerAlwaysPull:$ContainerAlwaysPull ` 24 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 25 | -doNotExportObjectsToText ` 26 | -enableSymbolLoading:$enableSymbolLoading 27 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupBCOnPrem.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bconprem' 4 | $ContainerAdditionalParameters += "--ip 172.21.31.14" 5 | 6 | $ContainerDockerImage = 'mcr.microsoft.com/businesscentral/onprem:13.1.25940.0-be-ltsc2019' 7 | $ContainerAlwaysPull = $true 8 | $enableSymbolLoading = $false 9 | #$SecretSettings.containerLicenseFile = 'c:\programdata\navcontainerhelper\NAV2018License.flf' 10 | 11 | 12 | New-RDHNAVContainer ` 13 | -DockerHost $DockerHost ` 14 | -DockerHostCredentials $DockerHostCredentials ` 15 | -DockerHostUseSSL:$DockerHostUseSSL ` 16 | -DockerHostSessionOption $DockerHostSessionOption ` 17 | -ContainerDockerImage $ContainerDockerImage ` 18 | -ContainerRegistryUserName $SecretSettings.containerRegistryUserName ` 19 | -ContainerRegistryPwd $SecretSettings.containerRegistryPassword ` 20 | -ContainerName $Containername ` 21 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 22 | -ContainerCredential $ContainerCredential ` 23 | -ContainerAlwaysPull:$ContainerAlwaysPull ` 24 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 25 | -doNotExportObjectsToText ` 26 | -enableSymbolLoading:$enableSymbolLoading 27 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupD365BE.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $ContainerDockerImage = 'microsoft/bcsandbox:be' 4 | $Containername = 'dyn365be' 5 | $ContainerAdditionalParameters += "--ip 172.21.31.7" 6 | 7 | $UserName = 'waldo' 8 | $Password = ConvertTo-SecureString 'waldo1234' -AsPlainText -Force 9 | $ContainerCredential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 10 | 11 | New-RDHNAVContainer ` 12 | -DockerHost $DockerHost ` 13 | -DockerHostCredentials $DockerHostCredentials ` 14 | -DockerHostUseSSL:$DockerHostUseSSL ` 15 | -DockerHostSessionOption $DockerHostSessionOption ` 16 | -ContainerDockerImage $ContainerDockerImage ` 17 | -ContainerName $Containername ` 18 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 19 | -ContainerCredential $ContainerCredential ` 20 | -ContainerAlwaysPull ` 21 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 22 | -doNotExportObjectsToText 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/SetupNav2018.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'nav2018' 4 | $ContainerAdditionalParameters += "--ip 172.21.31.12" 5 | 6 | #$ContainerDockerImage = 'microsoft/dynamics-nav:2018' 7 | $ContainerDockerImage = 'microsoft/dynamics-nav:2018-cu8-de' 8 | $ContainerAlwaysPull = $true 9 | $enableSymbolLoading = $false 10 | 11 | New-RDHNAVContainer ` 12 | -DockerHost $DockerHost ` 13 | -DockerHostCredentials $DockerHostCredentials ` 14 | -DockerHostUseSSL:$DockerHostUseSSL ` 15 | -DockerHostSessionOption $DockerHostSessionOption ` 16 | -ContainerDockerImage $ContainerDockerImage ` 17 | -ContainerName $Containername ` 18 | -ContainerLicenseFile $SecretSettings.containerLicenseFile ` 19 | -ContainerCredential $ContainerCredential ` 20 | -ContainerAlwaysPull:$ContainerAlwaysPull ` 21 | -ContainerAdditionalParameters $ContainerAdditionalParameters ` 22 | -doNotExportObjectsToText ` 23 | -enableSymbolLoading:$enableSymbolLoading 24 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/UpgradeApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'devpreview' 4 | $Appfilename = "$env:USERPROFILE\Dropbox\Cloud Ready Software\Projects\Microsoft\HDI Videos\waldo\HDI add upgrade logic to an extension\Apps\Books\Cloud Ready Software GmbH_BookShelf_1.0.0.0.app" 5 | 6 | Upgrade-RDHNAVApp ` 7 | -DockerHost $DockerHost ` 8 | -DockerHostCredentials $DockerHostCredentials ` 9 | -DockerHostUseSSL:$DockerHostUseSSL ` 10 | -DockerHostSessionOption $DockerHostSessionOption ` 11 | -ContainerName $Containername ` 12 | -AppFileName $Appfilename ` 13 | -Verbose -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_EnterDockerHost.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | Enter-PSSession ` 4 | -ComputerName $DockerHost ` 5 | -Credential $DockerHostCredentials ` 6 | -UseSSL:$DockerHostUseSSL ` 7 | -SessionOption $DockerHostSessionOption 8 | 9 | break 10 | 11 | Enter-NavContainer -containerName 'bccurrent' 12 | 13 | New-SmbShare -Path C:\ProgramData\NavContainerHelper -Name NavContainerHelper -FullAccess Administrator 14 | 15 | docker network create -d transparent tlan --subnet=172.21.31.0/24 --gateway=172.21.31.1 16 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_ExportObjects.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bconprem' 4 | $Path = 'C:\Temp\' 5 | $filter = '' 6 | 7 | Export-RDHNAVApplicationObjects ` 8 | -DockerHost $DockerHost ` 9 | -DockerHostCredentials $DockerHostCredentials ` 10 | -DockerHostUseSSL:$DockerHostUseSSL ` 11 | -DockerHostSessionOption $DockerHostSessionOption ` 12 | -ContainerName $Containername ` 13 | -Path $Path ` 14 | -filter $filter 15 | 16 | Start $Path 17 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_ExportObjectsAsAL.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $containerName = 'bconprem' 4 | $Path = 'C:\Temp\JCD' 5 | $filter = 'Type=3;Id=1306' 6 | 7 | $result = Export-RDHNAVApplicationObjectsAsAL ` 8 | -DockerHost $DockerHost ` 9 | -DockerHostCredentials $DockerHostCredentials ` 10 | -DockerHostUseSSL:$DockerHostUseSSL ` 11 | -DockerHostSessionOption $DockerHostSessionOption ` 12 | -ContainerName $containerName ` 13 | -Path $Path ` 14 | -filter $filter 15 | 16 | start $result 17 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_ImportDataPackage.ps1: -------------------------------------------------------------------------------- 1 | #Enter DockerContainer 2 | 3 | Enter-NavContainer -containerName 'devpreview' 4 | 5 | $ConfigurationPackageFiles = Get-ChildItem C:\ConfigurationPackages 6 | 7 | $ConfigurationPackageFiles | ForEach-Object { 8 | Import-NAVConfigurationPackageFile -Path $_.FullName -ServerInstance NAV 9 | 10 | } -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_ImportLicense.ps1: -------------------------------------------------------------------------------- 1 | <# Import-NavContainerLicense -containerName devpreview -licenseFile 'C:\ProgramData\NavContainerHelper\CRS - 6743401 NAV2018 W1.flf' 2 | 3 | Import-NAVServerLicense -ServerInstance NAV -LicenseFile 'C:\ProgramData\NavContainerHelper\5230132_003 and 004 IFACTO_NAV2018_BELGIUM_2018 07 30.flf' 4 | 5 | #> 6 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 7 | 8 | $LicenseFile = "C:\Users\ericw\Dropbox (Personal)\Dynamics NAV\Licenses\5230132_003 and 004 IFACTO_NAV2018_BELGIUM_2018 07 30.flf" 9 | $ContainerName = 'navserver' 10 | 11 | Import-RDHNAVContainerLicense ` 12 | -DockerHost $DockerHost ` 13 | -DockerHostCredentials $DockerHostCredentials ` 14 | -DockerHostUseSSL:$DockerHostUseSSL ` 15 | -DockerHostSessionOption $DockerHostSessionOption ` 16 | -ContainerName $ContainerName ` 17 | -LicenseFile $LicenseFile ` 18 | -Verbose -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_InstallTestCodeunits.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $Containername = 'bconprem' 4 | 5 | Import-RDHTestToolkitToNavContainer ` 6 | -DockerHost $DockerHost ` 7 | -DockerHostCredentials $DockerHostCredentials ` 8 | -DockerHostUseSSL:$DockerHostUseSSL ` 9 | -DockerHostSessionOption $DockerHostSessionOption ` 10 | -ContainerName $Containername ` 11 | -ContainerSqlCredential $ContainerSqlCredential 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_PrepDockerHost.ps1: -------------------------------------------------------------------------------- 1 | 2 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 3 | 4 | Install-RDHDependentModules ` 5 | -DockerHost $DockerHost ` 6 | -DockerHostCredentials $DockerHostCredentials ` 7 | -DockerHostUseSSL:$DockerHostUseSSL ` 8 | -DockerHostSessionOption $DockerHostSessionOption ` 9 | -ContainerName 'Upgrade' -ContainerModulesOnly -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_RebuildSearch.ps1: -------------------------------------------------------------------------------- 1 | $finsql = """C:\Program Files (x86)\Microsoft Dynamics NAV\130\RoleTailored Client\finsql.exe""" 2 | $ServerInstance = Get-NAVServerInstanceDetails -ServerInstance nav 3 | 4 | cmd /c "$finsql command=buildobjectsearchindex, servername=$($ServerInstance.DatabaseServer)\$($ServerInstance.DatabaseInstance), database=$($ServerInstance.DatabaseName), logfile=out.txt" 5 | if (Test-Path "Out.txt") { 6 | write-error (get-content out.txt) 7 | } 8 | 9 | Set-NAVServerInstance -ServerInstance NAV -Restart 10 | 11 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_StartDockerHostVM.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | 4 | Start-VM -Name $DockerHost 5 | 6 | #Restart-VM -Name $DockerHost 7 | 8 | 9 | -------------------------------------------------------------------------------- /PSScripts/NAV Docker/RemoteDocker/waldocorevm/_UpgradeNavApp.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 2 | 3 | $AppFile = "C:\Users\ericw\Dropbox (Personal)\GitHub\MostUselessAppEver\waldo_Most Useless App Ever_1.0.0.7.app" 4 | #$AppFile = "C:\Users\ericw\Dropbox (Personal)\GitHub\MostUselessDependencyEver\waldo_Most Useless Dependency App Ever_2.0.0.0.app" 5 | 6 | $Containername = 'devpreview' 7 | 8 | Upgrade-RDHNAVApp ` 9 | -DockerHost $DockerHost ` 10 | -DockerHostCredentials $DockerHostCredentials ` 11 | -DockerHostUseSSL:$DockerHostUseSSL ` 12 | -DockerHostSessionOption $DockerHostSessionOption ` 13 | -ContainerName $Containername ` 14 | -AppFileName $AppFile -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/CodeAnalysesInfo.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem "$env:USERPROFILE\.vscode\extensions" -Recurse -Filter "*.Nav.*Cop.dll" | 2 | Get-AlCodeCopInfo | 3 | Out-GridView 4 | 5 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/DeploymentExternalDeployer/DeployAppsWithExternalDeployer.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem (join-path $PSScriptRoot 'Functions') | % {. ($_.FullName)} 2 | 3 | $containerURL = "https://2a1b790adb.infra.ifacto.be/BC" 4 | $Path = "C:\Temp\appsNL" 5 | 6 | Load-BCModulesFromArtifacts 7 | 8 | $Paths = Get-AppDependencies -Path $Path -Type AppFiles 9 | 10 | $AppsToDeploy = $Paths | sort ProcessOrder 11 | 12 | if (!$Credential) { 13 | $Credential = Get-Credential -UserName 'wauteri' -Message 'Provide password' 14 | } 15 | 16 | foreach ($AppToDeploy in $AppsToDeploy) { 17 | Publish-BCAppWithExternalDeployer -Credential $Credential -EnvironmentURL $containerURL -Path $AppToDeploy.Path 18 | 19 | Get-BCDeploymentStatus -Credential $Credential -EnvironmentURL $containerURL 20 | } 21 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/DisableFeature.ps1: -------------------------------------------------------------------------------- 1 | Invoke-ScriptInBcContainer -containerName "demos" -scriptblock { 2 | invoke-sqlcmd -query "Update [dbo].[Tenant Feature Key] SET Enabled = 0 where ID = 'ExtensibleExchangeRateAdjustment'" -serverinstance "localhost\SQLEXPRESS" -database "CRONUS" 3 | invoke-sqlcmd -query "delete from [dbo].[Tenant Feature Key] where ID = 'ExtensibleExchangeRateAdjustment'" -serverinstance "localhost\SQLEXPRESS" -database "CRONUS" 4 | invoke-sqlcmd -query 'Update [dbo].[Feature Data Update Status$63ca2fa4-4f03-4f2b-a480-172fef340d3f] SET [Feature Status] = 0 where [Feature Key] = ''ExtensibleExchangeRateAdjustment''' -serverinstance "localhost\SQLEXPRESS" -database "CRONUS" 5 | 6 | set-navserverinstance BC -restart 7 | } 8 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/DownloadSymbols.ps1: -------------------------------------------------------------------------------- 1 | $cred = Get-Credential 2 | 3 | Get-AlSymbolFile ` 4 | -Publisher 'Microsoft' ` 5 | -AppName 'Application' ` 6 | -AppVersion '11.0.0.0' ` 7 | -DownloadFolder c:\Temp ` 8 | -Authentication NavUserPassword ` 9 | -Credential $cred 10 | 11 | Get-AlSymbolFile ` 12 | -Publisher 'Microsoft' ` 13 | -AppName 'System' ` 14 | -AppVersion '11.0.0.0' ` 15 | -DownloadFolder c:\Temp ` 16 | -Authentication NavUserPassword ` 17 | -Credential $cred 18 | 19 | start C:\temp -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/ExecuteObjects.ps1: -------------------------------------------------------------------------------- 1 | import-navmodules 2 | 3 | find-module | where author -eq 'waldo' | Update-Module 4 | 5 | $AppJson = Get-ObjectFromJSON '.\app.json' 6 | $LaunchJson = Get-ObjectFromJSON '.\.vscode\launch.json' 7 | 8 | Start-NAVApplicationObjectInWebClient ` 9 | -WebServerInstance $LaunchJson. ` 10 | -WebClientType Web ` 11 | -ObjectType Page ` 12 | -ObjectID 70050000 13 | 14 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/ExportTestApp/Export-TestApp.ps1: -------------------------------------------------------------------------------- 1 | $AppFolder = "C:\Users\ericw\Dropbox\GitHub\iFacto\KTN\Finance\W1" 2 | $TestFolder = "C:\Users\ericw\Dropbox\GitHub\iFacto\KTN\Finance\W1\Test" 3 | $TestAppFolder = "C:\Users\ericw\Dropbox\GitHub\iFacto\KTN\Finance\W1.Test" 4 | 5 | function IsTestCodeunit { 6 | param( 7 | [System.IO.FileInfo] $alFile 8 | ) 9 | 10 | #if (!(IsCodeunit -alFile)) {return $false} 11 | $alContent = $alFile | Get-Content 12 | $IsCodeunit = $null -ne ($alContent | Select-String '(codeunit) +([0-9]+) +("[^"]*"|[\w]*)([^"\n]*"[^"\n]*)?' -AllMatches) 13 | $IsTestCodeunit = $null -ne ($alContent | Select-String 'Subtype ?= ?Test' -AllMatches) 14 | return ($IsCodeunit -and $IsTestCodeunit) 15 | 16 | } 17 | 18 | function AllTestCodeunitFiles { 19 | param( 20 | [String] $AppFolder 21 | ) 22 | 23 | $TestCodeunits = @() 24 | 25 | foreach ($alFile in (Get-ChildItem $AppFolder -Recurse -Filter "*.al")) { 26 | if (IsTestCodeunit -alFile $alFile ){ 27 | $TestCodeunits += $alFile 28 | } 29 | } 30 | 31 | return $TestCodeunits 32 | } 33 | 34 | 35 | $AllCUs = AllTestCodeunitFiles -AppFolder $AppFolder 36 | $AllCUs.Count -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/IsSymbolOnly.ps1: -------------------------------------------------------------------------------- 1 | ### Change this 2 | $CodeAnalysisDLLPath = "C:\bcartifacts.cache\sandbox\21.2.49946.51980\platform\ServiceTier\program files\Microsoft Dynamics NAV\210\Service\Microsoft.Dynamics.Nav.CodeAnalysis.dll" 3 | $AppFilePath = "C:\_Source\iFacto\DistriApps\SALESPURCHBE\App\iFacto Business Solutions NV_Distri Sales and Purchase (Belgium)_21.2.0.0.app" 4 | $AppFilePath = "C:\_Source\Community\waldo.BCPerfTool\BCPerfTool\waldo_BCPerfTool_1.0.0.0.app" 5 | 6 | ### Run This 7 | add-type -Path "$($CodeAnalysisDLLPath)" 8 | $NavXFilepath = "$($AppFilePath)" 9 | 10 | Write-Host "*** Read App Manifest: [$($NavXFilepath)]." 11 | $FileStream = [System.IO.FileStream]::new($NavXFilepath ,[System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::Read) 12 | $Package = [Microsoft.Dynamics.Nav.CodeAnalysis.Packaging.NavAppPackageReader]::Create($FileStream) 13 | 14 | $Results = $Package.ReadSourceCodeFilePaths() 15 | if ($Results.Count -eq 0){ 16 | Write-Warning "*** The App will fail the 'IsSymbolOnlyCheck'" 17 | } else { 18 | Write-Host "*** The App passed the 'IsSymbolOnlyCheck' ! " -ForegroundColor Green 19 | } 20 | $FileStream.Close(); 21 | 22 | $Package | fl 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_AppSourcePrevious_PrepAll.ps1: -------------------------------------------------------------------------------- 1 | . (Join-path $PSScriptRoot '_Settings.ps1') 2 | 3 | foreach ($Target in $Targets) { 4 | $AppSourceCopPackagesFolderTarget = Join-Path $Target $AppSourceCopPackagesFolder 5 | $SymbolFolderTarget = get-item (join-path $target $SymbolFolder) 6 | if (Test-Path $AppSourceCopPackagesFolderTarget) { 7 | $apps = Get-ChildItem $AppSourceCopPackagesFolderTarget -Filter '*.app' 8 | foreach($app in $apps){ 9 | Write-Host -ForegroundColor Green "Copy $($app.Name) --> $SymbolFolderTarget" 10 | Copy-Item -Path $app.FullName -Destination $SymbolFolderTarget 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_App_Cleanup.ps1: -------------------------------------------------------------------------------- 1 | . (Join-path $PSScriptRoot '_Settings.ps1') 2 | 3 | foreach ($Target in $Targets) { 4 | write-Host $Target 5 | Get-ChildItem -Path $Target -Filter '*.app' -Recurse -Exclude "*\.appSourceCopPackages\*" | % { 6 | if ($_.FullName -like "*.appSourceCopPackages*"){ 7 | write-Host -ForegroundColor Yellow "Skipped $($_.FullName)" 8 | } else { 9 | $_ | Remove-Item -Force -Verbose 10 | } 11 | } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_LaunchJson_CopyToAll.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Copy Launch.json for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | Write-host "Base folder: $($BaseFolder)" 14 | 15 | $LaunchJson = get-ChildItem -Path $BaseFolder launch.json -Recurse 16 | 17 | if ($LaunchJson) { 18 | foreach ($Target in $Targets) { 19 | if ($Target -ne $BaseFolder) { 20 | $LaunchJson | Copy-Item -Destination (join-path $Target ".vscode") -Force -Verbose 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_OpenAppJsons.ps1: -------------------------------------------------------------------------------- 1 | . (Join-path $PSScriptRoot '_Settings.ps1') 2 | . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') 3 | 4 | 5 | $Command = "Get-childitem $Workspace\*.* -Recurse -filter ""App.json"" | % {code $('$_')}" 6 | $Command | clip.exe 7 | 8 | Write-host "Copied the following command to clipboard:" -ForegroundColor green 9 | Write-host " $Command" -ForegroundColor Yellow 10 | Write-host "Now past it in the terminal of your Multi-root workspace" -ForegroundColor green 11 | 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_Symbol_Cleanup.ps1: -------------------------------------------------------------------------------- 1 | . (Join-path $PSScriptRoot '_Settings.ps1') 2 | # . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') 3 | 4 | foreach ($Target in $Targets) { 5 | write-Host $Target 6 | Get-ChildItem -Path (join-path $Target $SymbolFolder) -Filter '*.app' | % { 7 | $_ | Remove-Item -Force -Verbose 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Apps_ZipTranslation.ps1: -------------------------------------------------------------------------------- 1 | . (Join-path $PSScriptRoot '_Settings.ps1') 2 | 3 | Get-ChildItem $Workspace -filter *.xlf -Recurse -Exclude "*TEST*" | 4 | Compress-Archive -DestinationPath (join-path $Workspace "translation.zip") -Force 5 | 6 | start $Workspace -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_CreateBranchFromMaster.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Discard all changes for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $MasterBranch = 'master' 14 | $NewBranch = Read-Host 'New Branch' 15 | 16 | foreach ($Target in $targetRepos) { 17 | write-host $Target -ForegroundColor Green 18 | Set-Location $Target 19 | & git remote prune origin 20 | & git checkout -q "$MasterBranch" 21 | & git pull 22 | & git push 23 | & git checkout -q -b "$NewBranch" 24 | & git checkout -q "$NewBranch" 25 | & git push -u origin "$NewBranch" 26 | } 27 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_DeleteBranch.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Deleting Branch" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $DeleteBranch = Read-host 'Delete Branch' 14 | 15 | foreach ($Target in $targetRepos) { 16 | write-host $Target -ForegroundColor Green 17 | Set-Location $Target 18 | & git branch -D "$DeleteBranch" 19 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_DiscardAll.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Discard all changes for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | 14 | if (-not(Confirm-YesOrNo -Message 'Are you sure to discard all?')) { break } 15 | 16 | foreach ($Target in $targetRepos) { 17 | write-host $Target -ForegroundColor Green 18 | Set-Location $Target 19 | & git reset --hard 20 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_PruneOrigin.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Customer' 4 | ) 5 | 6 | Write-Host "git remote prune origin" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | foreach ($Target in $targetRepos) { 14 | write-host $Target -ForegroundColor Green 15 | Set-Location $Target 16 | & git remote prune origin 17 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_StageAndCommit.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Stage and commit for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $Message = Read-host "Commit Message" 14 | 15 | foreach ($Target in $targetRepos) { 16 | write-host $Target -ForegroundColor Green 17 | Set-Location "$Target" 18 | 19 | & git stage . 20 | & git commit -m "$Message" 21 | & git push 22 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_SwitchBranch.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Discard all changes for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $ToBranch = Read-host 'To Branch' 14 | 15 | foreach ($Target in $targetRepos) { 16 | write-host $Target -ForegroundColor Green 17 | Set-Location $Target 18 | & git checkout -q "$ToBranch" 19 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_SyncMasterBranch.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Customer' 4 | ) 5 | 6 | Write-Host "Syncing Master Branch for $Type" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $MasterBranch = 'master' 14 | 15 | foreach ($Target in $targetRepos) { 16 | write-host $Target -ForegroundColor Green 17 | Set-Location $Target 18 | & git checkout -q "$MasterBranch" 19 | & git pull 20 | & git push 21 | } 22 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/Git_UpdateBranchFromMaster.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [validateset('Distri', 'Customer')] 3 | [String] $Type = 'Distri' 4 | ) 5 | 6 | Write-Host "Update branch from master" 7 | 8 | switch ($Type) { 9 | 'Distri' { . (Join-path $PSScriptRoot '_Settings.ps1') } 10 | 'Customer' { . (Join-path $PSScriptRoot '_SettingsCustomers.ps1') } 11 | } 12 | 13 | $FromBranch = 'master' 14 | $ToBranch = read-host 'To Branch' 15 | 16 | foreach ($Target in $targetRepos) { 17 | write-host $Target -ForegroundColor Green 18 | Set-Location $Target 19 | 20 | & git checkout -q "$FromBranch" 21 | & git pull 22 | & git checkout -q "$ToBranch" 23 | & git fetch 24 | & git pull origin "$FromBranch" 25 | & git push 26 | 27 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/_Settings.ps1: -------------------------------------------------------------------------------- 1 | $Workspace = "C:\_Source\iFacto\DistriApps\" 2 | $BaseFolder = join-path $workspace 'BASE\App' 3 | $SymbolFolder = '.alpackages' 4 | 5 | $AppJsons = Get-ChildItem $Workspace -Recurse 'app.json' 6 | 7 | $targetRepos = (Get-ChildItem $Workspace -Recurse -Hidden -Include '.git').Parent.FullName 8 | $Targets = $AppJsons.directory.fullname 9 | 10 | $AppSourceCopPackagesFolder = '.appSourceCopPackages' -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/MultiRootWorkspaces/_SettingsCustomers.ps1: -------------------------------------------------------------------------------- 1 | $Workspace = "C:\_Source\iFacto\Customers\" 2 | $BaseFolder = join-path $workspace 'All in 1\App' 3 | $SymbolFolder = '.alpackages' 4 | 5 | $AppJsons = Get-ChildItem $Workspace -Recurse 'app.json' 6 | 7 | $targetRepos = (Get-ChildItem $Workspace -Recurse -Hidden -Include '.git').Parent.FullName 8 | $Targets = $AppJsons.directory.fullname 9 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Removeextension.ps1: -------------------------------------------------------------------------------- 1 | import-module 'C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1' 2 | 3 | $AppJson = Get-ObjectFromJSON '.\app.json' 4 | 5 | Get-NAVAppInfo -ServerInstance navision_main -Tenant default | 6 | where Publisher -eq $AppJson.publisher | 7 | Uninstall-NAVApp 8 | 9 | Get-NAVAppInfo -ServerInstance navision_main | 10 | where Publisher -like $AppJson.publisher | 11 | Unpublish-NAVApp -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/RenumberAL.ps1: -------------------------------------------------------------------------------- 1 | $AppFolder = "C:\_Source\DistriApps\BASE\App" 2 | 3 | $ALFiles = Get-ChildItem $AppFolder -Recurse -Filter "*.al" 4 | 5 | $ALFiles -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 1.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 1 3 | Create an isolated environment in which we will convert the code 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | $imageName = 'mcr.microsoft.com/businesscentral/onprem' 8 | #$imageName = 'microsoft/bcsandbox:base' 9 | $licenseFile = 'https://www.dropbox.com/s/5cfyfnqdoyt23hi/_CRS%20-%206743401%20BC13%20W1.flf?dl=1' 10 | $DeltaPath = 'C:\ProgramData\NavContainerHelper\Migration\DELTA' 11 | 12 | $UserName = 'NAVUser' 13 | $Password = ConvertTo-SecureString "NAVUser123" -AsPlainText -Force 14 | $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 15 | 16 | $ContainerAdditionalParameters = @("--env isBcSandbox=Y","--cpu-count 8","--dns=8.8.8.8") 17 | 18 | New-NavContainer ` 19 | -accept_eula ` 20 | -containerName $ContainerName ` 21 | -auth NavUserPassword ` 22 | -credential $Credential ` 23 | -includeCSide ` 24 | -licensefile $licenseFile ` 25 | -imageName $imageName ` 26 | -updateHosts ` 27 | -additionalParameters $ContainerAdditionalParameters ` 28 | -accept_outdated 29 | 30 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 2.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 2 3 | Export Original objects (normal and new syntax) 4 | #> 5 | 6 | #Not Necessary .. already done by creating the container that way 7 | 8 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 3.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 3 3 | Apply Delta to database & export as new syntax 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | $DeltaPath = 'C:\ProgramData\NavContainerHelper\Migration\DELTA' 8 | 9 | $UserName = 'sa' 10 | $Password = ConvertTo-SecureString "NAVUser123" -AsPlainText -Force 11 | $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 12 | 13 | Import-DeltasToNavContainer -containerName $ContainerName -deltaFolder $DeltaPath -sqlCredential $Credential 14 | 15 | Compile-ObjectsInNavContainer -containerName $ContainerName ` 16 | -filter "Modified=1" ` 17 | -sqlCredential $Credential 18 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 4.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 4 3 | Export Modified objects (normal and new syntax) 4 | #> 5 | 6 | #Not necessary - included in step 6 -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 5.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 5 3 | Create Deltas in New Syntax 4 | #> 5 | 6 | #not necessary - included in step 6 7 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/Step 6.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 6 3 | Convert to New Syntax 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | 8 | $UserName = 'sa' 9 | $Password = ConvertTo-SecureString "NAVUser123" -AsPlainText -Force 10 | $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 11 | 12 | Convert-ModifiedObjectsToAl -containerName $ContainerName -startId 50110 -sqlCredential $Credential -Verbose 13 | 14 | start "C:\ProgramData\NavContainerHelper\Extensions\tempdev\al-newsyntax" -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/_EnterContainer.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | join the dockerhost first, before you will execute the steps 3 | #> 4 | 5 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 6 | 7 | if (-not($DockerHostSession)) { 8 | $DockerHostSession = New-PSSession -ComputerName $DockerHost -Credential $DockerHostCredentials -UseSSL:$DockerHostUseSSL -SessionOption $DockerHostSessionOption 9 | } 10 | Enter-PSSession -Session $DockerHostSession 11 | 12 | break 13 | 14 | Enter-NavContainer -containerName 'tempdev' -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al - navcontainerhelper/_Settings.ps1: -------------------------------------------------------------------------------- 1 | 2 | $DockerHost = 'waldocorevm' 3 | $DockerHostUseSSL = $false 4 | $DockerHostSessionOption = New-PSSessionOption 5 | 6 | if (-not ($DockerHostCredentials)){ 7 | $UserName = 'administrator' 8 | $DockerHostCredentials = Get-Credential -UserName $UserName -Message "Please provide password for $UserName" 9 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al/Step 1.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 1 3 | Create an isolated environment in which we will convert the code 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | $imageName = 'mcr.microsoft.com/businesscentral/sandbox:be' 8 | #$imageName = 'microsoft/bcsandbox:base' 9 | $licenseFile = 'https://www.dropbox.com/s/5cfyfnqdoyt23hi/_CRS%20-%206743401%20BC13%20W1.flf?dl=1' 10 | $DeltaPath = 'C:\ProgramData\NavContainerHelper\Migration\DELTA' 11 | 12 | $UserName = 'NAVUser' 13 | $Password = ConvertTo-SecureString "NAVUser123" -AsPlainText -Force 14 | $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) 15 | 16 | $ContainerAdditionalParameters = @("--env isBcSandbox=Y","--cpu-count 8","--dns=8.8.8.8") 17 | 18 | New-NavContainer ` 19 | -accept_eula ` 20 | -containerName $ContainerName ` 21 | -auth NavUserPassword ` 22 | -credential $Credential ` 23 | -includeCSide ` 24 | -licensefile $licenseFile ` 25 | -imageName $imageName ` 26 | -updateHosts ` 27 | -additionalParameters $ContainerAdditionalParameters ` 28 | -accept_outdated 29 | 30 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al/Step 5.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 5 3 | Create Deltas in New Syntax 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | $OriginalPath = 'C:\ProgramData\NavContainerHelper\Migration\ORIGINAL_NEW' 8 | $ModifiedPath = 'C:\ProgramData\NavContainerHelper\Migration\MODIFIED_NEW' 9 | $DeltaPath = 'C:\ProgramData\NavContainerHelper\Migration\DELTA_NEW' 10 | 11 | $Session = Get-NavContainerSession -containerName $ContainerName 12 | Invoke-Command -Session $Session -ScriptBlock { 13 | param( 14 | $OriginalPath, $ModifiedPath, $DeltaPath 15 | ) 16 | 17 | $null = Remove-Item -Path $DeltaPath -Recurse -Force -ErrorAction SilentlyContinue 18 | $null = New-Item -Path $DeltaPath -ItemType Directory 19 | 20 | Write-Host "Create delta in new syntax" 21 | $CompareResult = 22 | Compare-NAVApplicationObject ` 23 | -OriginalPath $OriginalPath ` 24 | -ModifiedPath $ModifiedPath ` 25 | -DeltaPath $DeltaPath ` 26 | -ExportToNewSyntax 27 | 28 | } -ArgumentList $OriginalPath, $ModifiedPath, $DeltaPath -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al/Step 6.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | STEP 6 3 | Convert to New Syntax 4 | #> 5 | 6 | $ContainerName = 'tempdev' 7 | $DeltaPath = 'C:\ProgramData\NavContainerHelper\Migration\DELTA_NEW' 8 | $AlPath = 'C:\ProgramData\NavContainerHelper\Migration\AL' 9 | $ExtensionStartId = 50000 10 | 11 | $Session = Get-NavContainerSession -containerName $ContainerName 12 | Invoke-Command -Session $Session -ScriptBlock { 13 | param( 14 | $DeltaPath, $AlPath, $ExtensionStartId 15 | ) 16 | 17 | Write-Host "Migrating to AL" 18 | $Arguments = @("--source=$DeltaPath", "--target=$AlPath", "--rename", "--extensionStartId $ExtensionStartId") 19 | 20 | Start-Process "$NavClientPath\txt2al.exe" -ArgumentList $Arguments 21 | 22 | } -ArgumentList $DeltaPath, $AlPath, $ExtensionStartId 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al/_EnterContainer.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | NOT used for the video - only to make my (waldo) life easier during development of the scripts 3 | #> 4 | 5 | . (Join-Path $PSScriptRoot '.\_Settings.ps1') 6 | 7 | if (-not($DockerHostSession)){ 8 | $DockerHostSession = New-PSSession -ComputerName $DockerHost -Credential $DockerHostCredentials -UseSSL:$DockerHostUseSSL -SessionOption $DockerHostSessionOption 9 | } 10 | Enter-PSSession -Session $DockerHostSession 11 | 12 | break 13 | 14 | Enter-NavContainer -containerName 'tempdev' -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/Txt2Al/_Settings.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | NOT used for the video - only to make my (waldo) life easier during development of the scripts 3 | #> 4 | 5 | $DockerHost = 'waldocorevm' 6 | $DockerHostUseSSL = $false 7 | $DockerHostSessionOption = New-PSSessionOption 8 | 9 | if (-not ($DockerHostCredentials)){ 10 | $UserName = 'administrator' 11 | $DockerHostCredentials = Get-Credential -UserName $UserName -Message "Please provide password for $UserName" 12 | } -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/UpdateMSDyn365bc.Code.History.ps1: -------------------------------------------------------------------------------- 1 | Set-location "C:\_Source\Microsoft\MSDyn365BC.Code.History" -errorAction SilentlyContinue 2 | Set-location "C:\_Source\MSDyn365BC.Code.History" -errorAction SilentlyContinue 3 | 4 | & git checkout -q "master" 5 | & git reset --hard "@{u}" 6 | & git clean -df 7 | & git pull -------------------------------------------------------------------------------- /PSScripts/NAV Extensions v2/ValidateAppsourceApps.ps1: -------------------------------------------------------------------------------- 1 | $NewFolder = "C:\Temp\AppSourceApps\New" 2 | $PrevFolder = "C:\Temp\AppSourceApps\Previous" 3 | 4 | $Newapps = Get-ChildItem $NewFolder 5 | $PrevApps = Get-ChildItem $PrevFolder 6 | 7 | Run-AlValidation ` 8 | -apps $Newapps.FullName ` 9 | -validateCurrent ` 10 | -countries 'be' ` 11 | -affixes AAI,APPD,ASPR,CASHR,CHF,CLCH,CPLA,CREA,CRON,CSF,CSH,CUSF,DAR,DHE,DOCMAIL,DRL,DSE,DTS,ECCO,ECE,ECF,ECME,EDII,EFORM,EIT,ENVI,ERR,FFI,FIF,FILE,FINREP,FSU,HIS,HLI,IAR,ICON,IDR,IIM,INTRAST,INVF,INP,ISC,ITFE,JQM,JTS,LEM,LTE,MARG,META,MFF,NTT,OGM,OSO,OTY,PGR,PLF,PMENU,PORF,POST,PRME,QOE,RDT,RELD,REST,RHE,RPO,SOR,SPEC,SPRE,RCSP,SQF,SSF,SHR,STAH,STAU,ISUP,ITAX,TOPIC,TST,VNDF,VMF,VVC,WAO,WBR,WFB,WHSESCAN,WPR,WRO,WSO,WSW,WTO,BSE,LGI,CPSP,CPLOG,EDI-PEPPOL,EDIIP,FNC,FNCSP,SALESPURCH,COD,TEST,IFC,IFT,ETR,TDO,ICPR,DGD ` 12 | -sasToken $SecretSettings.InsiderSASToken ` 13 | -validateNextMajor 14 | # -previousApps $PrevApps.FullName ` 15 | 16 | 17 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/2_ApplyDeltasInDEV.ps1: -------------------------------------------------------------------------------- 1 | # Import settings 2 | . (Join-Path $PSScriptRoot '_Settings.ps1') $DeltaPath = join-path $PSScriptRoot '..\AppFiles\*.DELTA' #Import Deltas Apply-NAVDelta -DeltaPath $DeltaPath ` -TargetServerInstance $ModifiedServerInstance ` -Workingfolder $NavAppWorkingFolder ` -OpenWorkingfolder ` -SynchronizeSchemaChanges Force ` -DeltaType Add ` -VersionList $AppName ` -ErrorAction Stop Start-NAVIdeClient -Database $ModifiedServerInstance -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/3_CreatePermissionSets.ps1: -------------------------------------------------------------------------------- 1 | $PermissionSets = @() 2 | 3 | New-NAVAppPermissionSet ` 4 | -ServerInstance $ModifiedServerInstance ` -AppName $AppName ` -PermissionType Read ` -OnTableIDs 50000 5 | 6 | New-NAVAppPermissionSet ` 7 | -ServerInstance $ModifiedServerInstance ` -AppName $AppName ` -PermissionType Write ` -OnTableIDs 50000 8 | 9 | <# 10 | List of table you should probably handle! 11 | 12 | $Tables = Invoke-NAVSQL -ServerInstance $ModifiedServerInstance -SQLCommand 'select * from Object where Modified=1 and Type=1' 13 | $Tables.ID 14 | 15 | #> -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/4_OpenDEVEnvironment.ps1: -------------------------------------------------------------------------------- 1 | # Import settings 2 | . (Join-Path $PSScriptRoot '_Settings.ps1') -ErrorAction Stop 3 | 4 | #Load modules (to be able to run this script as stand-alone as well) 5 | Import-Module (Get-ChildItem 'C:\Program Files' -Recurse | where FullName -like '*NAVAdminTool.ps1*').FullName 6 | Import-Module (Get-ChildItem 'C:\Program Files (x86)' -Recurse | where FullName -like '*Microsoft.Dynamics.Nav.Model.Tools.psd1').FullName 7 | 8 | Start-NAVIdeClient $ModifiedServerInstance 9 | 10 | <# 11 | start-navwindowsclient $ModifiedServerInstance 12 | #> -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/6_BackupApp.ps1: -------------------------------------------------------------------------------- 1 | # Import settings 2 | . (Join-Path $PSScriptRoot '_Settings.ps1') -ErrorAction Stop 3 | 4 | $CreatedITems = Backup-NAVApplicationObjects ` -BackupOption OnlyModified ` -ServerInstance $ModifiedServerInstance ` -BackupPath $BackupPath ` -Name $AppName ` -NavAppOriginalServerInstance $OriginalServerInstance ` -NavAppWorkingFolder $NavAppWorkingFolder ` 5 | -CompleteReset 6 | 7 | 8 | start $BackupPath -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD/HelloWorldOnCustomerList.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Extensions/OLD/HelloWorldOnCustomerList.txt -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD2/Backup DEV Objects.ps1: -------------------------------------------------------------------------------- 1 | # Import settings 2 | . (Join-Path $PSScriptRoot 'Set-NAVExtensionSettings.ps1') 3 | 4 | Backup-NAVApplicationObjects ` 5 | -ServerInstance $ModifiedServerInstance ` 6 | -BackupOption OnlyModified ` 7 | -BackupPath $BackupModifiedObjectsPath ` 8 | -NavAppOriginalServerInstance $OriginalServerInstance ` 9 | -NavAppWorkingFolder $NavAppWorkingFolder ` 10 | -ExportPermissionSetId $AppName ` 11 | | copy-item -Destination $BackupCloudFolder -Recurse -Force 12 | 13 | Start $BackupCloudFolder 14 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD2/Create DEV Environment.ps1: -------------------------------------------------------------------------------- 1 | # Import settings 2 | . (Join-Path $PSScriptRoot 'Set-NAVExtensionSettings.ps1') -ErrorAction Stop 3 | 4 | $CopyFromServerInstance = Get-NAVServerInstance $DefaultServerInstance -ErrorAction Stop 5 | 6 | $Backupfile = $CopyFromServerInstance | Backup-NAVDatabase -ErrorAction Stop 7 | 8 | $CopyFromServerInstance | Enable-NAVServerInstancePortSharing 9 | 10 | New-NAVEnvironment -ServerInstance $OriginalServerInstance -BackupFile $Backupfile -ErrorAction Stop -EnablePortSharing -LicenseFile $License 11 | New-NAVEnvironment -ServerInstance $ModifiedServerInstance -BackupFile $Backupfile -ErrorAction Stop -EnablePortSharing -LicenseFile $License 12 | New-NAVEnvironment -ServerInstance $TargetServerInstance -BackupFile $Backupfile -ErrorAction Stop -EnablePortSharing -LicenseFile $License 13 | 14 | #ConvertTo-NAVMultiTenantEnvironment -ServerInstance $TargetServerInstance -MainTenantId $TargetTenant 15 | 16 | $Backupfile | Remove-Item -Force 17 | 18 | Get-NAVServerInstance4 | where serverinstance -match $AppName | select ServerInstance, DatabaseName, ClientServicesPort, State | ft -AutoSize 19 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD2/Remove DEV Environment.ps1: -------------------------------------------------------------------------------- 1 | . (Join-Path $PSScriptRoot 'Set-NAVExtensionSettings.ps1') -ErrorAction Stop 2 | 3 | $DEVServerInstanceObject = get-navserverinstance3 -serverinstance $ModifiedServerInstance 4 | 5 | #Export-NAVApplicationObject -Filter 'Modified=1' -DatabaseServer $DEVServerInstanceObject.DatabaseServer -DatabaseName $DEVServerInstanceObject.DatabaseName -Path $BackupDEVChangesfile -Force -ErrorAction Stop 6 | 7 | Remove-NAVEnvironment -ServerInstance $OriginalServerInstance 8 | Remove-NAVEnvironment -ServerInstance $ModifiedServerInstance -BackupModifiedObjectsPath $BackupModifiedObjectsPath 9 | Remove-NAVEnvironment -ServerInstance $TargetServerInstance 10 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD2/Reset Test Environment.ps1: -------------------------------------------------------------------------------- 1 |  2 | # Import settings 3 | . (Join-Path $PSScriptRoot 'Set-NAVExtensionSettings.ps1') 4 | 5 | #Rebuild Test Environment 6 | $CopyFromServerInstance = Get-NAVServerInstance $OriginalServerInstance 7 | 8 | Remove-NAVEnvironment -ServerInstance $TargetServerInstance 9 | 10 | $CopyFromServerInstance | Copy-NAVEnvironment -ToServerInstance $TargetServerInstance 11 | ConvertTo-NAVMultiTenantEnvironment -ServerInstance $TargetServerInstance -MainTenantId $TargetTenant 12 | 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/OLD2/Set-NAVExtensionSettings.ps1: -------------------------------------------------------------------------------- 1 | #The app 2 | $AppName = 'CRS_Ext' 3 | $AppPublisher = 'Cloud Ready Software GmbH' 4 | $AppDescription = 'Description' 5 | $InitialAppVersion = '1.0.0.0' 6 | 7 | #The build environment 8 | $WorkingFolder = 'C:\_Workingfolder' 9 | 10 | $OriginalServerInstance = "$($AppName)_Original" 11 | $ModifiedServerInstance = "$($AppName)_DEV" 12 | $TargetServerInstance = "$($AppName)_QA" 13 | $TargetTenant = 'Default' 14 | $License = 'C:\_Installs\5230132_003 and 004 IFACTO_NAV2016_BELGIUM_2015 11 03.flf' 15 | 16 | #Defaults 17 | $DefaultServerInstance = 'DynamicsNAV90' 18 | $NavAppWorkingFolder = join-path $WorkingFolder $AppName 19 | $BackupModifiedObjectsPath = Join-Path $NavAppWorkingFolder 'BackupObjects' 20 | $BackupCloudFolder = 'C:\Users\Administrator\Dropbox\GitHub\Cloud.Ready.Software.Extensions\Rental App\Backup Objects' -------------------------------------------------------------------------------- /PSScripts/NAV Extensions/_Settings.ps1: -------------------------------------------------------------------------------- 1 | #The app 2 | $AppName = 'HelloWorld' 3 | $AppPublisher = 'Cloud Ready Software GmbH' 4 | $AppDescription = 'HelloWorld' 5 | $InitialAppVersion = '1.0.0.0' 6 | $IncludeFilesInNavApp = '' 7 | $WebServicePrefix = 'HWW' 8 | $Logo = get-item '..\Images\Icon.png' 9 | 10 | #The build environment 11 | $WorkingFolder = 'C:\_Workingfolder' 12 | 13 | $OriginalServerInstance = "Shared_ORIG" 14 | $ModifiedServerInstance = "$($AppName)_DEV" 15 | $TargetServerInstance = "Shared_TEST" 16 | $TargetTenant = 'Default' 17 | $License = "C:\Users\Administrator\Dropbox\Dynamics NAV\Licenses\2017 DEV License.flf" 18 | $ISVNumberRangeLowestNumber = 50000 19 | 20 | #Defaults 21 | $DefaultServerInstance = 'DynamicsNAV100' 22 | $NavAppWorkingFolder = join-path $WorkingFolder $AppName 23 | $BackupPath = [io.path]::GetFullPath((Join-Path $PSScriptRoot '\..\')) 24 | 25 | #Run Test 26 | $TestWindowsClient = $false 27 | $TestWebClient = $true 28 | $TestTabletClient = $false 29 | $TestPhoneClient = $false -------------------------------------------------------------------------------- /PSScripts/NAV Installation/2018/FullInstallNAV2018.ps1: -------------------------------------------------------------------------------- 1 | $Name = 'NAV_11_CTP08' 2 | $isofile = "C:\_Installs\$Name.iso" 3 | $ConfigFile = join-path $PSScriptRoot 'FullInstallNAV2018.xml' 4 | $Licensefile = "C:\Users\Administrator\Dropbox\Dynamics NAV\Licenses\2017 DEV License.flf" 5 | $Objectlibrary = 'C:\Users\Administrator\Dropbox\Dynamics NAV\ObjectLibrary' 6 | $Exportfile = Join-Path $Objectlibrary "$Name.zip" 7 | $Log = 'c:\Temp\Log.txt' 8 | 9 | $InstallationResult = 10 | Install-NAVFromISO ` 11 | -ISOFilePath $isofile ` 12 | -ConfigFile $ConfigFile ` 13 | -Licensefile $Licensefile ` 14 | -Log $Log ` 15 | -DisableCompileBusinessLogic 16 | 17 | break 18 | 19 | #Export Objects 20 | if (-not (Test-Path $Exportfile)){ 21 | Import-NAVModules 22 | 23 | write-host -foregroundcolor Green -Object "Exporting all objects to $Objectlibrary" 24 | 25 | $TempFile = "$env:TEMP\$name.txt" 26 | 27 | Export-NAVApplicationObject -DatabaseName $InstallationResult.Databasename -Path $TempFile -ExportTxtSkipUnlicensed -ErrorAction Stop 28 | 29 | Get-Item $TempFile | Create-ZipFileFromPipedItems -zipfilename $Exportfile 30 | Remove-Item $TempFile -Force -ErrorAction SilentlyContinue 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /PSScripts/NAV Installation/Install VM with ISO.ps1: -------------------------------------------------------------------------------- 1 | #Run this script as administrator!! 2 | $VMName = 'Win2012R2+SQL2014+Office2013' 3 | $VMSnapshot = 'Win2012R2+SQL2014+Office2013' 4 | $ISOPath = 'C:\$Installs\NAVCorfuCTP12.iso' 5 | 6 | 7 | #Checkpoint-VM -Name $VMName 8 | #Get-VMSnapshot -VMName $VMName -Name $VMSnapshot | Restore-VMSnapshot -Confirm:$true 9 | 10 | #Set-VMDvdDrive -VMName $VMName -Path $ISOPath 11 | 12 | Start-VM -Name $VMName 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Installation/InstallNAVFromDVD.ps1: -------------------------------------------------------------------------------- 1 | $Licensefile = 'C:\Dropbox\Dynamics NAV\Licenses\5230132_003 and 004 IFACTO_NAV2016_BELGIUM_2015 11 03.flf' 2 | $NAVDVD = 'E:\' 3 | $ConfigFile = join-path $PSScriptRoot 'FullInstallMadeiraCTP.xml' 4 | $Log = 'C:\Temp\Log.txt' 5 | 6 | $InstallationResult = Install-NAV -DVDFolder $NAVDVD -Configfile $ConfigFile -Log $Log 7 | 8 | $null = Import-Module (join-path $InstallationResult.TargetPathX64 'service\navadmintool.ps1' ) 9 | 10 | write-host -ForegroundColor Green -Object "Installing licensefile '$Licensefile'" 11 | $null = Get-NAVServerInstance | Import-NAVServerLicense -LicenseFile $LicenseFile 12 | write-host -ForegroundColor Green -Object "Restarting $($installationresult.ServerInstance)" 13 | $null = Get-NAVServerInstance | Set-NAVServerInstance -Restart 14 | 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Installation/License Upload/Import-License To All ServerInstances.ps1: -------------------------------------------------------------------------------- 1 | $LicenseFile = Get-ChildItem "$PSScriptRoot\5230132_003 and 004 IFACTO_NAV2015_BELGIUM_2014 10 02.flf" 2 | 3 | if ($LicenseFile.Count -gt 1) { 4 | Write-Error "$($LicenseFile.Count) licenses found on $PSScriptRoot" 5 | break 6 | } 7 | 8 | Get-NAVServerInstance | Import-NAVServerLicense -LicenseFile $LicenseFile.FullName 9 | Get-NAVServerInstance | Set-NAVServerInstance -Restart -------------------------------------------------------------------------------- /PSScripts/NAV Installation/VM - testing testing.ps1: -------------------------------------------------------------------------------- 1 | $VMAdminUserName = 'Administrator' 2 | $VMAdminPassword = '' 3 | 4 | $credentialParam = @{} 5 | if ($VMAdminUserName -and $VMAdminPassword) 6 | { 7 | $secureVMAdminPassword = ConvertTo-SecureString $VMAdminPassword -AsPlainText -Force 8 | $credential = New-Object System.Management.Automation.PSCredential ($VMAdminUserName, $secureVMAdminPassword) 9 | 10 | $credentialParam.Add("Credential", $credential) 11 | } 12 | 13 | $session = New-PSSession 169.254.108.158 -Authentication Negotiate -Credential @credential 14 | 15 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CompareObjectFilesAndRemoveIdentical.ps1: -------------------------------------------------------------------------------- 1 | 2 | $CompareResult = 3 | Compare-NAVApplicationObject ` 4 | -OriginalPath .\DistriDEV ` 5 | -ModifiedPath .\DistriDEV_Translated ` 6 | -DeltaPath .\Delta ` 7 | -PassThru 8 | 9 | $Items = @() 10 | $CompareResult | where CompareResult -ne 'Identical' | % { 11 | $Items += get-item(join-path ".\DistriDEV_Translated" "$((get-item $_.PSPath).BaseName).txt") 12 | } 13 | 14 | $Items | Join-NAVApplicationObjectFile -Destination .\DistriDEV_Translated_Filtered.Txt 15 | 16 | Split-NAVApplicationObjectFile ` 17 | -Source .\DistriDEV_Translated_Filtered.Txt ` 18 | -Destination .\DistriDEV_Translated_Filtered 19 | 20 | $Items = Get-ChildItem .\DistriDEV_Translated_Filtered 21 | $Items | Get-NAVApplicationObjectProperty | % { 22 | 23 | Set-NAVApplicationObjectProperty ` 24 | -TargetPath $_.FileName ` 25 | -VersionListProperty "$($_.versionList),M32436" ` 26 | -ModifiedProperty Yes ` 27 | -DateTimeProperty (get-date -Format g) 28 | 29 | } 30 | $Items | Join-NAVApplicationObjectFile -Destination .\DistriDEV_Translated_Filtered.Txt -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CopyLanguage/CopyLanguage.ps1: -------------------------------------------------------------------------------- 1 | #Copy language (e.g. from NLD to NLB) 2 | $Source = ".\NoLanguages.txt" 3 | $FromLanguage = "ENU" 4 | $ToLanguage = "NLB" 5 | $Destination = "Result.txt" 6 | 7 | cd C:\_PowerShell\Test_Languages\CopyLanguage 8 | 9 | $FromTranslations = (Export-NAVApplicationObjectLanguage ` 10 | -Source $Source ` 11 | -LanguageId $FromLanguage ` 12 | -Destination (Join-Path "." "$FromLanguage.txt") ` 13 | -Force -PassThru).TranslateLines.'<>3__source'.TranslateLines 14 | 15 | $ToTranslations = (Export-NAVApplicationObjectLanguage ` 16 | -Source $Source ` 17 | -LanguageId $ToLanguage ` 18 | -Destination (Join-Path "." "$ToLanguage.txt") ` 19 | -Force -PassThru).TranslateLines.'<>3__source'.TranslateLines 20 | 21 | $i = 0 22 | for ($i = 0; $i -le ($FromTranslations.Count - 1) ; $i++) 23 | { 24 | $ToTranslations[$i].Value = $FromTranslations[$i].Value 25 | } 26 | 27 | $ToTranslations.Line | Set-Content -Path (Join-Path "." $Destination) 28 | . (Join-Path "." $Destination) 29 | 30 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CopyLanguage/ENU.txt: -------------------------------------------------------------------------------- 1 | T54100-F1-P8629-A1033-L999:Code 2 | T54100-F2-P8629-A1033-L999:Description 3 | T54100-P8629-A1033-L999:Test Languages 4 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CopyLanguage/NLB.txt: -------------------------------------------------------------------------------- 1 | T54100-F1-P8629-A2067-L999: 2 | T54100-F2-P8629-A2067-L999: 3 | T54100-P8629-A2067-L999: 4 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CopyLanguage/Result.txt: -------------------------------------------------------------------------------- 1 | T54100-F1-P8629-A2067-L999:Code 2 | T54100-F2-P8629-A2067-L999:Description 3 | T54100-P8629-A2067-L999:Test Languages 4 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CreateLanguageENUFromFieldnames/CreateLanguageENUFromFieldnames.ps1: -------------------------------------------------------------------------------- 1 | #Create ENU Language From Fieldnames 2 | $Source = ".\Objects.txt" 3 | 4 | 5 | cd C:\_PowerShell\Test_Languages\CreateLanguageENUFromFieldnames 6 | 7 | (Export-NAVApplicationObjectLanguage ` 8 | -Source $Source ` 9 | -Destination (Join-Path "." "ENU.txt") ` 10 | -LanguageId ENU ` 11 | -DevelopmentLanguageId ENU ` 12 | -Force -PassThru).TranslateLines.'<>3__source'.TranslateLines 13 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/CreateLanguageENUFromFieldnames/Objects.txt: -------------------------------------------------------------------------------- 1 | OBJECT Table 54100 Test Languages 2 | { 3 | OBJECT-PROPERTIES 4 | { 5 | Date=13/02/15; 6 | Time=20:30:06; 7 | Modified=Yes; 8 | Version List=; 9 | } 10 | PROPERTIES 11 | { 12 | } 13 | FIELDS 14 | { 15 | { 1 ; ;Code ;Code10 } 16 | { 2 ; ;Description ;Text30 } 17 | } 18 | KEYS 19 | { 20 | { ;Code ;Clustered=Yes } 21 | } 22 | FIELDGROUPS 23 | { 24 | } 25 | CODE 26 | { 27 | 28 | BEGIN 29 | END. 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/Export Languages with missing languages/ExportLanguagesIncludingMissingLanguages.ps1: -------------------------------------------------------------------------------- 1 | #Export Languages with missing laguages 2 | $Languages = "ENU","NLB","FRB" 3 | $Exportfile = "ExportedTranslation.txt" 4 | $SortOnObject = $true 5 | 6 | cd 'C:\_PowerShell\Test_Languages\Export Languages with missing languages' 7 | 8 | Export-NAVApplicationObjectLanguage ` 9 | -Source .\NoLanguages.txt ` 10 | -LanguageId $Languages ` 11 | -Destination (Join-Path "." $Exportfile) ` 12 | -Force 13 | 14 | if ($SortOnObject) { 15 | Get-Content (Join-Path "." $Exportfile) | sort | Set-Content (Join-Path "." $Exportfile) -Force 16 | } 17 | 18 | . (Join-Path "." $Exportfile) -------------------------------------------------------------------------------- /PSScripts/NAV Languages/Export Languages with missing languages/ExportedTranslation.txt: -------------------------------------------------------------------------------- 1 | T54100-F1-P8629-A1033-L999:Code 2 | T54100-F1-P8629-A2060-L999: 3 | T54100-F1-P8629-A2067-L999: 4 | T54100-F2-P8629-A1033-L999:Description 5 | T54100-F2-P8629-A2060-L999: 6 | T54100-F2-P8629-A2067-L999: 7 | T54100-P8629-A1033-L999:Test Languages 8 | T54100-P8629-A2060-L999: 9 | T54100-P8629-A2067-L999: 10 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/Export Languages with missing languages/NoLanguages.txt: -------------------------------------------------------------------------------- 1 | OBJECT Table 54100 Test Languages 2 | { 3 | OBJECT-PROPERTIES 4 | { 5 | Date=13/02/15; 6 | Time=20:30:06; 7 | Modified=Yes; 8 | Version List=; 9 | } 10 | PROPERTIES 11 | { 12 | } 13 | FIELDS 14 | { 15 | { 1 ; ;Code ;Code10 } 16 | { 2 ; ;Description ;Text30 } 17 | } 18 | KEYS 19 | { 20 | { ;Code ;Clustered=Yes } 21 | } 22 | FIELDGROUPS 23 | { 24 | } 25 | CODE 26 | { 27 | 28 | BEGIN 29 | END. 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/TestBasics.ps1: -------------------------------------------------------------------------------- 1 | #Step 1: create DEV Hash 2 | $AnalyzeLanguages = 'NLB', 'FRB', 'ENU' 3 | $DEVLang = 'ENU' 4 | 5 | $DEVHash = 6 | Export-NAVApplicationObjectLanguageHash ` 7 | -Source C:\Temp\ObjectsWithLanguages.txt ` 8 | -DestinationXML C:\Temp\DevHash.xml ` 9 | -LanguageId $AnalyzeLanguages ` 10 | -DevelopmentLanguageId $DEVLang ` 11 | -WorkingFolder C:\_WorkingFolder 12 | 13 | $ObjectLanguages = 14 | Get-NAVApplicationObjectLanguage ` 15 | -Source C:\Temp\ObjectsWithLanguages.txt ` 16 | -WorkingFolder c:\_WorkingFolder ` 17 | -LanguageId $AnalyzeLanguages ` 18 | -DevelopmentTranslations $DEVHash ` 19 | -NotOnlyMissingTranslations 20 | 21 | cls 22 | $ObjectLanguages | ogv 23 | -------------------------------------------------------------------------------- /PSScripts/NAV Languages/TestCreatingDictionary.ps1: -------------------------------------------------------------------------------- 1 | $Dictionary = @() 2 | $test = @{'ENU'='Sales Order'} 3 | $Dictionary += $Test 4 | $test = @{'NLB'='Bestelling'} 5 | $Dictionary += $Test 6 | $test = @{'FRB'='Commande'} 7 | $Dictionary += $Test 8 | $test = @{'Sales Order-FRB'='Commande'} 9 | $Dictionary += $Test 10 | 11 | if([string]::IsNullOrEmpty($Dictionary.'Sales Order-NLB')){ 12 | $test = @{'Sales Order-NLB'='Bestelling'} 13 | $Dictionary += $Test 14 | } 15 | 16 | $Dictionary -------------------------------------------------------------------------------- /PSScripts/NAV Languages/TranslateModule.ps1: -------------------------------------------------------------------------------- 1 | #Step 1: create DEV Hash $AnalyzeLanguages = 'NLB','ENU' $DEVLang = 'ENU' $DEVHash = Export-NAVApplicationObjectLanguageHash ` -Source C:\Workingfolder\TranslatePSC\PSC.txt ` -DestinationXML C:\Workingfolder\TranslatePSC\\DevHash.xml ` -LanguageId $AnalyzeLanguages ` -DevelopmentLanguageId $DEVLang ` -WorkingFolder C:\Workingfolder\TranslatePSC\ $ObjectLanguages = Get-NAVApplicationObjectLanguage ` -Source C:\Workingfolder\TranslatePSC\PSC.txt ` -WorkingFolder C:\Workingfolder\TranslatePSC\ ` -LanguageId $AnalyzeLanguages ` -DevelopmentTranslations $DEVHash ` -NotOnlyMissingTranslations cls $ObjectLanguages | Export-Csv C:\Workingfolder\TranslatePSC\Translation.csv break Import-NAVApplicationObjectLanguage -Source C:\Workingfolder\TranslatePSC\PSC.txt -LanguagePath C:\Workingfolder\TranslatePSC\FinalTranslation.txt -Destination C:\Workingfolder\TranslatePSC\PSC_Translated.txt -Force -------------------------------------------------------------------------------- /PSScripts/NAV Objects/Fix_Versionlist.ps1: -------------------------------------------------------------------------------- 1 | $Objects = Get-NAVApplicationObjectProperty -Source C:\_Customers\distri_TestVersionlist.txt 2 | $VersionListPrefixes = 'NAVW1', 'NAVBE', 'I','Test' 3 | 4 | foreach ($Object in $Objects){ 5 | 6 | $newVersionlist = Merge-NAVVersionList -OriginalVersionList $Object.VersionList -ModifiedVersionList '' -TargetVersionList '' -Versionprefix $VersionListPrefixes 7 | 8 | "$($Object.VersionList) --> $newVersionlist" 9 | } 10 | $Object -------------------------------------------------------------------------------- /PSScripts/NAV Product Release/TEST.ps1: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $objectfile = 'C:\_PowerShell\Scripts\Product Release\Rental\Rental.txt' 5 | $ProductVersion = 'IRM 4.0' 6 | $VersionPrefix = 'NAVW1','NAVBE','I7','I8','IB','EQM','IRM' 7 | 8 | 9 | $VersionLIst = 'I7.1,IRM 3.1,M18567' 10 | Release-NAVVersionList -VersionList $VersionLIst -ProductVersion $ProductVersion -Versionprefix $VersionPrefix 11 | $VersionLIst = 'EQM1' 12 | Release-NAVVersionList -VersionList $VersionLIst -ProductVersion $ProductVersion -Versionprefix $VersionPrefix 13 | $VersionLIst = 'I7.3,IB1.0,M18722' 14 | Release-NAVVersionList -VersionList $VersionLIst -ProductVersion $ProductVersion -Versionprefix $VersionPrefix 15 | $VersionLIst = 'M18722' 16 | Release-NAVVersionList -VersionList $VersionLIst -ProductVersion $ProductVersion -Versionprefix $VersionPrefix 17 | -------------------------------------------------------------------------------- /PSScripts/NAV Test Toolset/ImportAllTestCodeunits.fob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/waldo1001/Cloud.Ready.Software.PowerShell/058ff4b25efdd63dc64c30435995a07b31a4212c/PSScripts/NAV Test Toolset/ImportAllTestCodeunits.fob -------------------------------------------------------------------------------- /PSScripts/NAV Test Toolset/Log/navcommandresult.txt: -------------------------------------------------------------------------------- 1 | [0] [08/10/15 15:35:31] The command completed successfully. -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/CU/InstallCU.ps1: -------------------------------------------------------------------------------- 1 |  2 | #Install the CU 3 | Get-NAVVersion 4 | 5 | Get-NAVCumulativeUpdateDownloadVersionInfo -SourcePath $CUDownloadFile 6 | 7 | $IsoFile = 8 | New-NAVCumulativeUpdateISOFile ` 9 | -CumulativeUpdateFullPath $CUDownloadFile ` 10 | -IsoDirectory $IsoDirectory 11 | 12 | Repair-NAVFromISO -ISOFilePath $IsoFile -Log 'c:\TEMP\Log.txt' 13 | 14 | Get-NAVVersion 15 | 16 | UnInstall-NAVFromISO -ISOFilePath $IsoFile -Log 'c:\TEMP\Log.txt' 17 | Drop-SQLDatabaseIfExists -Databasename 'NAV2016' -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/CU/SendMail.ps1: -------------------------------------------------------------------------------- 1 | $SMTPServer = 'relay.iconos.be' 2 | $ToAddress ='eric.wauters@ifacto.be' 3 | $FromAddress = 'PowerShell@ifacto.be' 4 | $Subject = 'Test mail from PowerShell' 5 | $Body = ' 6 | No 7 | Serious 8 | Body 9 | content 10 | ' 11 | 12 | Send-MailMessage -to $ToAddress -From $FromAddress -Subject $Subject -Body $Body -SmtpServer $SMTPServer -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/CU/Set-UpgradeSettings.ps1: -------------------------------------------------------------------------------- 1 | #General 2 | $UpgradeName = 'TestCustomer' 3 | $WorkingFolder = "C:\_Workingfolder\Upgrade_$UpgradeName" 4 | $ObjectLibrary = 'C:\_ObjectLibrary' 5 | $ModifiedFolder = 'C:\_Workingfolder\CustomerDBs' 6 | $NAVLicense = 'C:\_Installs\5230132_003 and 004 IFACTO_NAV2016_BELGIUM_2015 11 03.flf' 7 | $UpgradeCodeunitsFullPath = 'E:\UpgradeToolKit\Local Objects\Upgrade800900.BE.fob' 8 | $VersionListPrefixes = 'NAVW1', 'NAVBE' 9 | 10 | 11 | #Original Version 12 | $OriginalVersion = 'NAV2015_CUx_BE' 13 | $OriginalObjects = join-path $ObjectLibrary "$($OriginalVersion).txt" 14 | 15 | #Modified Version 16 | $ModifiedServerInstance = $UpgradeName 17 | $ModifiedObjects = join-path $ModifiedFolder "$($ModifiedServerInstance).txt" 18 | $ModifiedDatabaseBackupLocation = join-path $ModifiedFolder "$($ModifiedServerInstance).bak" 19 | 20 | #Target Version 21 | $TargetVersion = 'NAV2016_CU1' 22 | $TargetServerInstance = 'DynamicsNAV90' 23 | $TargetObjects = join-path $ObjectLibrary "$($TargetVersion).txt" 24 | 25 | #Result Version 26 | $ResultObjectFile = Join-Path $WorkingFolder "$($ResultServerInstance).fob" 27 | 28 | -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/CU/Set-UpgradeSettings_TestCustomer.ps1: -------------------------------------------------------------------------------- 1 | #General 2 | $UpgradeName = 'TestCustomer' 3 | $WorkingFolder = "C:\_Workingfolder\Upgrade_$UpgradeName" 4 | $ObjectLibrary = 'C:\_Workingfolder\ObjectLibrary' 5 | $ModifiedFolder = 'C:\_Workingfolder\CustomerDBs' 6 | $NAVLicense = 'C:\_Installs\5230132_003 and 004 IFACTO_NAV2016_BELGIUM_2015 11 03.FLF' 7 | $UpgradeCodeunitsFullPath = 'D:\UpgradeToolKit\Local Objects\Upgrade800900.BE.fob' 8 | $VersionListPrefixes = 'NAVW1', 'NAVBE' 9 | 10 | 11 | #Original Version 12 | $OriginalVersion = 'NAV2015_CUx_BE' 13 | $OriginalObjects = join-path $ObjectLibrary "$($OriginalVersion).txt" 14 | 15 | #Modified Version 16 | $ModifiedServerInstance = $UpgradeName 17 | $ModifiedObjects = join-path $ModifiedFolder "$($ModifiedServerInstance).txt" 18 | $ModifiedDatabaseBackupLocation = join-path $ModifiedFolder "$($ModifiedServerInstance).bak" 19 | 20 | #Target Version 21 | $TargetVersion = 'NAV2016_BE' 22 | $TargetServerInstance = $TargetVersion 23 | $TargetObjects = join-path $ObjectLibrary "$($TargetVersion).txt" 24 | 25 | #Result Version 26 | $ResultObjectFile = Join-Path $WorkingFolder "$($ResultServerInstance).fob" 27 | 28 | -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/Conflicts/AnalyzeConflicts.ps1: -------------------------------------------------------------------------------- 1 | $ConflictFiles = Get-ChildItem 'C:\Users\waldo\Dropbox\GitHub\iFacto.Products.Distri\Upgrade_Distri92_NAV2017CTP27\Conflicts' 2 | 3 | $Conflicts = @() 4 | foreach($ConflictFile in $ConflictFiles){ 5 | Write-host $ConflictFile.BaseName 6 | $ObjectConflictHints = @() 7 | $ObjectConflictHints = (Get-Content $ConflictFile.FullName | Where-Object {$_ -like '*ConflictHint*'}).TrimStart() 8 | 9 | foreach ($ObjectConflictHint in $ObjectConflictHints){ 10 | $Conflict = New-Object PSObject 11 | $Conflict | Add-Member -MemberType NoteProperty -Name 'Object' -Value $ConflictFile.BaseName 12 | $Conflict | Add-Member -MemberType NoteProperty -Name 'ConflictHint' -Value $ObjectConflictHint 13 | $Conflicts += $Conflict 14 | } 15 | } -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/CreateNewOriginalFromTwoVersions.ps1: -------------------------------------------------------------------------------- 1 | Split-NAVApplicationObjectFile -Source C:\_ObjectLibrary\Distri82.txt -Destination C:\_ObjectLibrary\Distri82 2 | Split-NAVApplicationObjectFile -Source C:\_ObjectLibrary\Distri81.txt -Destination C:\_ObjectLibrary\Distri81_Diginet 3 | 4 | split-navapplicationobjectfile -source C:\_Workingfolder\_CustomerDBs\Diginet_AfterRemovingToIncrease.txt -Destination C:\_Workingfolder\_CustomerDBs\Diginet_AfterRemovingToIncrease 5 | 6 | 7 | $ModifiedObjectsFolder = 'C:\_Workingfolder\_CustomerDBs\Diginet_AfterRemovingToIncrease' 8 | $NewOriginalFolder = 'C:\_ObjectLibrary\Distri81_Diginet' 9 | $CopiedOriginalFolder = 'C:\_ObjectLibrary\Distri82' 10 | 11 | 12 | $ObjectProps = Get-NAVApplicationObjectProperty -Source (join-path $ModifiedObjectsFolder '*.txt') 13 | 14 | $ObjectProps | where VersionList -match '8\.2' | Foreach { 15 | $ObjectFileToCopy = Get-Item $_.FileName 16 | Copy-Item -Path (Join-Path $CopiedOriginalFolder $objectfiletocopy.Name) -Destination (Join-Path $NewOriginalFolder $objectfiletocopy.Name) -Force 17 | } 18 | 19 | Join-NAVApplicationObjectFile -Source $NewOriginalFolder -Destination "$($NewOriginalFolder).txt" 20 | -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/DownloadCU/Test Download CU with KB URL.ps1: -------------------------------------------------------------------------------- 1 |  2 | Get-NAVCumulativeUpdateFileFromKBArticleURL ` -KBArticleURL 'https://mbs2.microsoft.com/Knowledgebase/kbdisplay.aspx?scid=kb,en-us,3166287' ` -DownloadFolder 'C:\_Download' -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/DownloadCU/Test_DownloadCU.ps1: -------------------------------------------------------------------------------- 1 | Get-NAVCumulativeUpdateFile -versions 2017 2 | Get-NAVCumulativeUpdateFile -versions 2017 -CountryCode W1 -DownloadFolder C:\_Download 3 | Get-NAVCumulativeUpdateFile -versions 2017 -Locale fr-FR -CountryCode BE -DownloadFolder C:\_Download 4 | Get-NAVCumulativeUpdateFile -versions 2017 -Locale fr-FR -CountryCode BE -DownloadFolder C:\_Download -ShowDownloadFolder 5 | -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/DownloadCU/Test_NAVCumulativeUpdateHelper.ps1: -------------------------------------------------------------------------------- 1 | Load-NAVCumulativeUpdateHelper 2 | 3 | $Locales = [MicrosoftDownload.MicrosoftDownloadParser]::GetDownloadLocales(54317) 4 | $MyDownload = $Locales | out-gridview -PassThru | foreach { 5 | $_.DownloadUrl 6 | Start-BitsTransfer -Source $_.DownloadUrl -Destination C:\_Download\Filename.zip 7 | } 8 | 9 | 10 | $MyDownload = [MicrosoftDownload.MicrosoftDownloadParser]::GetDownloadDetail(54317, 'en-US') | Select-Object * 11 | $MyDownload 12 | 13 | 14 | $resourceFiles = New-Object System.Collections.ArrayList(,$MyDownload) 15 | 16 | $resourceFiles = New-Object System.Collections.ArrayList($null) 17 | $resourceFiles.AddRange($MyDownload) -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/HandleLanguagesAfterUpgrade.ps1: -------------------------------------------------------------------------------- 1 | $ResultFolder = 'C:\_Workingfolder\Upgrade_NH\MergeResult_ChangedOnly - Result' 2 | $ResultFileName = join-path $WorkingFolder 'Result.txt' 3 | $LanguageFolder = (join-path $WorkingFolder 'Languages') 4 | $LanguageFileFilter = "$($(get-item $ModifiedObjects).basename)*.*" 5 | $LanguageJoinedFileName = join-path $WorkingFolder 'CustomLanguages.txt' 6 | $LanguageResultFileName = $ResultFileName = join-path $WorkingFolder 'Result_WithLanguages.txt' 7 | 8 | 9 | Join-NAVApplicationObjectFile -Source $ResultFolder -Destination $ResultFileName -Force 10 | 11 | if (Test-Path $LanguageFolder){ 12 | $LanguageFiles = Get-ChildItem $LanguageFolder -Filter $LanguageFileFilter 13 | 14 | $LanguageFiles | Join-NAVApplicationObjectLanguageFile -Destination $LanguageJoinedFileName 15 | 16 | Import-NAVApplicationObjectLanguage -Source $ResultFileName -LanguagePath $LanguageJoinedFileName -Destination $LanguageResultFileName 17 | } -------------------------------------------------------------------------------- /PSScripts/NAV Upgrades/RemoveEnvironments.ps1: -------------------------------------------------------------------------------- 1 | . (join-path $PSScriptRoot 'Set-UpgradeSettings.ps1') 2 | 3 | $UpgradedServerInstance | Remove-NAVEnvironment 4 | -------------------------------------------------------------------------------- /PSScripts/Remote PowerShell/ClientSide.ps1: -------------------------------------------------------------------------------- 1 | Import-Certificate -Filepath "C:\temp\cert" -CertStoreLocation "Cert:\LocalMachine\Root" 2 | 3 | Enter-PSSession -ComputerName WIN-K5JLU49T31O -UseSSL -Credential (Get-Credential) -------------------------------------------------------------------------------- /PSScripts/Remote PowerShell/ServerSide.ps1: -------------------------------------------------------------------------------- 1 | #Source: https://4sysops.com/archives/powershell-remoting-over-https-with-a-self-signed-ssl-certificate/ 2 | 3 | $Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName ([net.dns]::GetHostName()) 4 | 5 | Export-Certificate -Cert $Cert -FilePath C:\temp\cert 6 | 7 | Enable-PSRemoting -SkipNetworkProfileCheck -Force 8 | 9 | dir wsman:\localhost\listener 10 | 11 | Get-ChildItem WSMan:\Localhost\listener | Where -Property Keys -eq "Transport=HTTP" | Remove-Item -Recurse 12 | Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse 13 | 14 | New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Cert.Thumbprint –Force 15 | 16 | New-NetFirewallRule -DisplayName "Windows Remote Management (HTTPS-In)" -Name "Windows Remote Management (HTTPS-In)" -Profile Any -LocalPort 5986 -Protocol TCP 17 | 18 | Set-Item WSMan:\localhost\Service\EnableCompatibilityHttpsListener -Value true 19 | Set-NetConnectionProfile -NetworkCategory Private 20 | 21 | Disable-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)" 22 | 23 | Write-Host "Copy the certificate (c:\temp\cert) to the local machine" -------------------------------------------------------------------------------- /PSScripts/_Samples/CompileNAVObjects.ps1: -------------------------------------------------------------------------------- 1 | Measure-Command { 2 | Compile-NAVApplicationObjectInParallel -ServerInstance DynamicsNAV90 -SynchronizeSchemaChanges Yes 3 | } 4 | 5 | Measure-Command { 6 | Compile-NAVApplicationObject NAV2016 -Recompile -SynchronizeSchemaChanges Yes 7 | } 8 | 9 | <# 10 | Days : 0 11 | Hours : 0 12 | Minutes : 13 13 | Seconds : 32 14 | Milliseconds : 339 15 | Ticks : 8123392182 16 | TotalDays : 0,00940207428472222 17 | TotalHours : 0,225649782833333 18 | TotalMinutes : 13,53898697 19 | TotalSeconds : 812,3392182 20 | TotalMilliseconds : 812339,2182 21 | 22 | Days : 0 23 | Hours : 0 24 | Minutes : 10 25 | Seconds : 41 26 | Milliseconds : 306 27 | Ticks : 6413061523 28 | TotalDays : 0,00742252491087963 29 | TotalHours : 0,178140597861111 30 | TotalMinutes : 10,6884358716667 31 | TotalSeconds : 641,3061523 32 | TotalMilliseconds : 641306,1523 33 | 34 | #> 35 | 36 | -------------------------------------------------------------------------------- /PSScripts/_Samples/Download Files/DownloadFilesFromDirectionsEmea.ps1: -------------------------------------------------------------------------------- 1 | $StorageDirectory = 'c:\Temp' 2 | 3 | $WebSite = Invoke-WebRequest -Uri http://directionsemea.com/media/mannheim-2015/presentations-from-directions-emea-2015-in-mannheim/ 4 | 5 | $WebSite.Links | 6 | where href -like '*/media/*' | 7 | where {-not($_.href -like '*/')} | 8 | select href | foreach { 9 | $url = 'http://www.directionsemea.com' + $_.href 10 | 11 | $Filename = [io.path]::GetFileName($url) 12 | 13 | $webclient = New-Object System.Net.WebClient 14 | $file = "$StorageDirectory\$Filename" 15 | 16 | $webclient.DownloadFile($url,$file) 17 | 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /PSScripts/_Samples/Workshop Examples/PermissionStaat.ps1: -------------------------------------------------------------------------------- 1 | $AllUserPermissionSets = @() 2 | 3 | $Tenants = Get-NAVServerInstance | Get-NAVTenant 4 | foreach($Tenant in $Tenants){ 5 | $UserPermissionsets = $Tenant | Get-NAVServerUserPermissionSet 6 | 7 | 8 | foreach($UserPermissionset in $UserPermissionsets){ 9 | 10 | $UserPermissionset | Add-Member -MemberType NoteProperty -Name ServerName -Value ([net.dns]::GetHostName()) 11 | $UserPermissionset | Add-Member -MemberType NoteProperty -Name ServerInstance -Value $Tenant.ServerInstance 12 | $UserPermissionset | Add-Member -MemberType NoteProperty -Name Tenant -Value $Tenant.Id 13 | 14 | $AllUserPermissionSets += $UserPermissionset 15 | } 16 | } 17 | 18 | $AllUserPermissionSets | Select ServerName, ServerInstance, Tenant, UserName, PermissionSetID, CompanyName, Scope | ft 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------