This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$puId = "40" | |
$url = "https://d365opsasteuiwypep2gu3b.blob.core.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47-e54b86e7/njj7L1Up2RUdqSA1tKG4Tw?skoid=9ef30196-cd78-4a47-955e-89a3947f0a23&sktid=975f013f-7f24-47e8-a7d3-abc4752bf346&skt=2024-06-21T06%3A17%3A36Z&ske=2024-06-24T07%3A17%3A36Z&sks=b&skv=2024-05-04&sv=2024-05-04&st=2024-06-21T06%3A17%3A36Z&se=2024-06-24T07%3A17%3A36Z&sr=b&sp=r&sig=hSWXJzM9VGPDHWOMBtQTqNoFgg7CQbeZeWJP%2FX0kJMw%3D" | |
$file = "d:\$puId.zip" | |
C:\DynamicsTools\azcopy.exe cp "$url" $file | |
mkdir d:\pu | |
C:\DynamicsTools\7za.exe x $file -od:\pu\ | |
pushd d:\pu | |
C:\DynamicsTools\UpdateDevBox.ps1 $puId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fragment> | |
<choose> | |
<when condition="@(null != context.Variables.GetValueOrDefault<string>("LaWfName", null))"> | |
<cache-lookup-value key="@(context.Variables.GetValueOrDefault<string>("LaWfName", null))" variable-name="LAWfTriggerUri" caching-type="internal" /> | |
<choose> | |
<when condition="@(string.IsNullOrEmpty(context.Variables.GetValueOrDefault<string>("LAWfTriggerUri", null)))"> | |
<send-request mode="new" timeout="20" ignore-error="false" response-variable-name="LAWfTriggerResponse"> | |
<set-url>@{ | |
var laName = context.Variables.GetValueOrDefault<string>("LaName", null); | |
var laWfName = context.Variables.GetValueOrDefault<string>("LaWfName", null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export to .env file - Does not work with Windows Poershell 5.1 | |
$tmpFile = [System.IO.Path]::GetTempFileName() | |
Write-Verbose -Verbose "Using $tmpFile" | |
gh variable list --json name,value --template "{{range .}}{{.name}}={{.value}}`n{{end}}" | Out-File -FilePath $tmpFile -Encoding utf8NoBOM | |
# cd to new repo or update Owner/Repo | |
gh variable set --env-file $tmpFile --repo Owner/Repo | |
Remove-Item $tmpFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<staticContent> | |
<mimeMap fileExtension="." mimeType="text/plain" /> | |
</staticContent> | |
</system.webServer> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER [[email protected]] FROM EXTERNAL PROVIDER | |
sp_addrolemember @rolename = 'db_datawriter', @membername = '[email protected]' | |
sp_addrolemember @rolename = 'db_datareader', @membername = '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE CREDENTIAL [https://_name_.blob.core.windows.net/backup] WITH IDENTITY='Shared Access Signature', SECRET='sp=racwdl&st=2023-06-01T12:17:10Z&se=2024-01-01T21:17:10Z&spr=https&sv=2022-11-02&sr=c&sig=doW...3D' | |
DECLARE @dbToBackup as sysname = 'DB' | |
DECLARE @folder as nvarchar(50) = 'shrinked' | |
DECLARE @file as nvarchar(100) = @dbToBackup + N'_' + FORMAT(GETDATE(), N'yyyy-MM-dd_hhmmss') + N'.bak' | |
DECLARE @destUrl as nvarchar(500) = N'https://_name_.blob.core.windows.net/backup/' + @folder + N'/' + @file | |
PRINT @destUrl | |
BACKUP DATABASE @dbToBackup TO | |
URL = @destUrl | |
WITH NOFORMAT, NOINIT, NAME = N'Full Database Backup', NOSKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rra = [System.Collections.Generic.List[Microsoft.Open.AzureAD.Model.RequiredResourceAccess]]::new() | |
$ra = [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new() | |
$ra.ResourceAppId = "00000003-0000-0000-c000-000000000000" # graph | |
$ra.ResourceAccess = [Microsoft.Open.AzureAD.Model.ResourceAccess]::new("e1fe6dd8-ba31-4d61-89e7-88639da4683d", "Scope") # User.Read | |
$rra.Add($ra) | |
$ra = [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new() | |
$ra.ResourceAppId = "00000007-0000-0000-c000-000000000000" # CDS / Dynamics CRM | |
$ra.ResourceAccess = [Microsoft.Open.AzureAD.Model.ResourceAccess]::new("78ce3f0f-a1ce-49c2-8cde-64b5c0896db4", "Scope") #user_impersonation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select top 100 * | |
from DeploymentInstanceArtifact | |
select top 100 * | |
from OrchestratorCommand | |
order by QueuedDateTime desc | |
select top 100 * | |
from OrchestratorJob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function InitializeWindowsCredential | |
{ | |
Write-Verbose ("Loading PasswordVault Class.") | |
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime] | |
} | |
InitializeWindowsCredential | |
function ConvertTo-PasswordCredential | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
--TOP 100 | |
AllocUnitName, | |
Operation, | |
COUNT(*) c, | |
SUM([Log Record Length]) l | |
FROM sys.fn_dblog(NULL,NULL) | |
GROUP BY | |
AllocUnitName, | |
Operation |
NewerOlder