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
#Execute Read-Host once and comment out | |
#Read-Host "Enter password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\passwordNEW.txt" | |
$TenantName="CRM106438" # Change to your tenant name | |
$Username = $("admin@{0}.onmicrosoft.com" -f $TenantName) | |
$Password = cat "C:\Temp\passwordNEW.txt" | ConvertTo-SecureString | |
$Creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $Password | |
Connect-MicrosoftTeams -Credential $Creds | |
Connect-ExchangeOnline -Credential $Creds | |
Connect-SPOservice -url $("https://{0}-admin.sharepoint.com" -f $TenantName) -Credential $Creds | |
Connect-Msolservice -Credential $Creds |
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 | |
( | |
[Parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$true)] | |
[ValidateNotNullOrEmpty()] | |
[Alias("FileName")] | |
[string]$FileName2Process | |
) |
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
# Starter pipeline | |
# Start with a minimal pipeline that you can customize to build and deploy your code. | |
# Add steps that build, run tests, deploy, and more: | |
# https://aka.ms/yaml | |
trigger: | |
branches: | |
include: | |
- '*' | |
paths: |
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
parameters: | |
# unique name of the job | |
job_name: deploy_sppkg | |
# friendly name of the job | |
display_name: Upload & deploy *.sppkg to SharePoint app catalog | |
# agent pool details (default: MSFT hosted Ubuntu) | |
pool: Default | |
# vmImage: ubuntu-latest | |
# name of target enviroment deploying to | |
target_environment: '' |
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
parameters: | |
# unique name of the job | |
job_name: deploy_sppkg | |
# friendly name of the job | |
display_name: Upload & deploy *.sppkg to SharePoint app catalog | |
# agent pool details (default: MSFT hosted Ubuntu) | |
pool: Default | |
# vmImage: ubuntu-latest | |
# name of target enviroment deploying to | |
target_environment: '' |
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
parameters: | |
# unique name of the job | |
job_name: build_package | |
# friendly name of the job | |
display_name: SPFx production build & packaging | |
# agent pool details (default: MSFT hosted Ubuntu) | |
pool: Default | |
# vmImage: ubuntu-latest | |
# relative path to the project root if not in root of repo | |
working_directory: '.' |
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
clear | |
# Application (client) ID, secret, tenant name and site | |
$tenantPrefix = "M365x162783"; | |
$clientId = "ca2a60c7-d09a-4875-841b-117a02b504fd"; #client-app | |
$clientSecret = "A------- blah- blah--eGX_soM7SEiKAhe"; TODO | |
$tenantName = $tenantPrefix +".onmicrosoft.com"; | |
$tenantDomain = $tenantPrefix +".sharepoint.com"; | |
$sitePath = "https://M365x162783.sharepoint.com/sites/lbtest1" | |
$siteName = $sitePath.Split("/")[4] |
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
using namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
# Write to the Azure Functions log stream. | |
Write-Host "PowerShell HTTP trigger function processed a request." | |
# get the PFX secret from the key vault | |
$tenantPrefix = "M365x162783"; # replace with your tenant id TODO to replace |
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
using namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
# Write to the Azure Functions log stream. | |
Write-Host "PowerShell HTTP trigger function processed a request." | |
# get the PFX secret from the key vault | |
$tenantPrefix = "M365x162783"; # replace with your tenant id TODO to replace |
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
{ | |
"definition": { | |
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
"actions": { | |
"BodyForAzureFunction": { | |
"inputs": { | |
"Action": "@{triggerBody()?['GrantRevoke']?['Value']}", | |
"ClientAppID": "@{triggerBody()?['ApplicationID']?['Value']}", | |
"DisplayName": "@{triggerBody()?['ApplicationID_x003a_AppName']?['Value']}", | |
"Permission": "@{triggerBody()?['ReadWrite']?['Value']}", |