wsl --install ubuntu
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
Connect-PnPOnline -ClientId c53eb8da-8bdf-44f9-8718-1fb1bbbbbb ` | |
-Thumbprint EC1E61510AEC35624AF78FEA763D00000000 ` | |
-Tenant "tenant.co.uk" -Url "https://tenant.sharepoint.com" | |
$token = Get-PnPGraphAccessToken | |
# Create header with the access token | |
$header = @{ Authorization = "Bearer $($token)" } | |
#v1.0/Beta |
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
Initialize-PnPPowerShellAuthentication -ApplicationName CaPa.Reporting ` | |
-Tenant "tenant.co.uk" -Store CurrentUser -ValidYears 2 ` | |
-CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) | |
# Output Example from PS: | |
# | |
# AzureAppId Certificate Thumbprint | |
# ---------- ---------------------- | |
# c53eb8da-8bdf-44f9-8718-1fb1bbbbbb EC1E61510AEC35624AF78FEA763D00000000 | |
# |
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
[CmdletBinding()] | |
Param | |
( | |
[string]$SiteUrl | |
) | |
# Refer to https://github.com/pnp/PnP-PowerShell/tree/master/Samples/Connect.AzureAutomation | |
# for setting up Azure Automation using an App Only connection to SharePoint Online | |
# Retrieves from the Azure Automation variables and certificate stores |
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
Connect-PnPOnline https://tenant.sharepoint.com/sites/yoursite | |
Apply-PnPProvisioningTemplate -Path "UK-Locale-Example-Provisioning-Template.xml" |
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
Connect-PnPOnline https://tenant.sharepoint.com/sites/yoursite | |
$LocaleId = 2057 # UK | |
$TimeZoneId = 2 # London | |
$web = Get-PnPWeb -Includes RegionalSettings,RegionalSettings.TimeZones | |
$timeZone = $web.RegionalSettings.TimeZones | Where-Object {$_.Id -eq $TimeZoneId} | |
$web.RegionalSettings.LocaleId = $LocaleId | |
$web.RegionalSettings.TimeZone = $timeZone | |
$web.Update() | |
Invoke-PnPQuery |
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
{ | |
"$schema": "schema.json", | |
"actions": [ | |
{ | |
"verb": "setRegionalSettings", | |
"timeZone":2, | |
"locale":2057, | |
"sortOrder":25, | |
"hourFormat":"24" |
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
################################### | |
# Prerequisites | |
# Update package lists | |
sudo apt-get update | |
# Install libunwind8 and libssl1.0 | |
# Regex is used to ensure that we do not install libssl1.0-dev, as it is a variant that is not required | |
sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y |
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
wget https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh | |
chmod +x dotnet-install.sh | |
# Ignore warnings | |
./dotnet-install.sh --channel LTS --architecture arm --install-dir ~/cli | |
# Allows running dotnet anywhere - thanks to | |
# this article https://edi.wang/post/2019/9/29/setup-net-core-30-runtime-and-sdk-on-raspberry-pi-4 | |
sudo nano .profile | |
export DOTNET_ROOT=$HOME/cli |
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
$Tenant = "yourtenant.onmicrosoft.com" | |
$AppName = "PnP-PowerShell Automation Example", | |
$CertificatePassword = "1234", # <-- Use a better one than this, nice a super complex | |
$ValidForYears = 2, | |
$CertCommonName = "PnP-PowerShell Automation Example", | |
$location = Get-Location # Get the location of the script to copy the script locally | |
Initialize-PnPPowerShellAuthentication -ApplicationName $AppName -Tenant $Tenant -OutPath $location ` | |
-CertificatePassword (ConvertTo-SecureString -String $CertificatePassword -AsPlainText -Force) -ValidYears $ValidForYears ` | |
-CommonName $CertCommonName |
NewerOlder