Skip to content

Instantly share code, notes, and snippets.

View paulczy's full-sized avatar

Paul Czywczynski paulczy

View GitHub Profile
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# Login to PowerApps for the Admin commands
Write-Host "Installing Module Microsoft.PowerApps.Administration.PowerShell"
Install-Module Microsoft.PowerApps.Administration.PowerShell -Force -Scope CurrentUser
Write-Host "Listing Power App environments..."
Get-AdminPowerAppEnvironment | Format-Table -Property EnvironmentName, DisplayName, Location
Write-Host "Listing Power App environments..."
Get-AdminFlow | Format-Table -Property DisplayName, Enabled, FlowName, EnvironmentName
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
$serverUrl = Read-Host -Prompt "Dynamics URL (ex: https://akoyago.crm.dynamics.com)"
$connectionString = "AuthType=OAuth;Integrated Security=true;Url=$serverUrl;AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;TokenCacheStorePath=c:\MyTokenCache\msal_cache.data;LoginPrompt=Auto"
# Login to PowerApps for the Admin commands
Write-Host "Installing Module: Microsoft.PowerApps.Administration.PowerShell"
Install-Module Microsoft.PowerApps.Administration.PowerShell -Force -Scope CurrentUser
#Write-Host "Login to PowerApps for the Admin commands"
# Add-PowerAppsAccount
# Login to PowerApps for the Xrm.Data commands
Write-Host "Installing Module: Microsoft.Xrm.Data.PowerShell -Force -Scope CurrentUser"
@paulczy
paulczy / CustomHtmlGenerator.cs
Created June 24, 2022 16:51 — forked from FWest98/CustomHtmlGenerator.cs
.NET Core 3 Custom Validation Classnames
using System.Collections.Generic;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.Options;
[CmdletBinding()]
Param(
# gather permission requests but don't create any AppId nor ServicePrincipal
[switch] $DryRun = $false,
# other possible Azure environments, see: https://docs.microsoft.com/en-us/powershell/module/azuread/connect-azuread?view=azureadps-2.0#parameters
[string] $AzureEnvironment = "AzureCloud",
[ValidateSet(
"UnitedStates",
"Preview(UnitedStates)",
@paulczy
paulczy / InstallBromelkampGOmanagerUserConnectorSPN.ps1
Last active May 20, 2022 22:50
InstallBromelkampGOmanagerUserConnectorSPN.ps1
[CmdletBinding()]
Param(
# gather permission requests but don't create any AppId nor ServicePrincipal
[switch] $DryRun = $false,
# other possible Azure environments, see: https://docs.microsoft.com/en-us/powershell/module/azuread/connect-azuread?view=azureadps-2.0#parameters
[string] $AzureEnvironment = "AzureCloud",
[ValidateSet(
"UnitedStates",
"Preview(UnitedStates)",
@paulczy
paulczy / allowlistforpihole.txt
Created November 1, 2021 03:14 — forked from shanselman/allowlistforpihole.txt
A gist with an ALLOW LIST for a PiHole to make sure your XBox and Windows Services keeps working and appropriate anonymized telemetry goes where it needs to go
analytics.twitter.com
api.mixpanel.com
api.segment.io
attestation.xboxlive.com
az416426.vo.msecnd.net
browser.pipe.aria.microsoft.com
c.bing.com
c.msn.com
c1.microsoft.com
cdn-gl.imrworldwide.com
[CmdletBinding()]
Param(
# gather permission requests but don't create any AppId nor ServicePrincipal
[switch] $DryRun = $false,
# other possible Azure environments, see: https://docs.microsoft.com/en-us/powershell/module/azuread/connect-azuread?view=azureadps-2.0#parameters
[string] $AzureEnvironment = "AzureCloud",
[ValidateSet(
"UnitedStates",
"Preview(UnitedStates)",
@paulczy
paulczy / Instructions.md
Created September 8, 2021 19:25 — forked from NickCraver/Microsoft.PowerShell_profile.ps1
Craver's oh-my-posh profile

Included here are the PowerShell profile I use as well as the oh-my-posh 3 config, but in addition to these you'll need:

  1. The PowerShell modules:
    • For git in PowerShell, I use posh-git
    • For prompt customization, I use oh-my-posh
    • For file/folder icons I use the excellent Terminal-Icons package by @devblackops: https://github.com/devblackops/Terminal-Icons
    • To install each:
Install-Module -Name posh-git -Repository PSGallery
Install-Module -Name oh-my-posh -Repository PSGallery