Language Formala:
@{replace(replace(triggerOutputs()?['body/{Path}'],'SitePages/', ''),'/','')}
#requires -Modules @{ ModuleName="Microsoft.Graph.Authentication"; ModuleVersion="2.0.0" } | |
#requires -Modules @{ ModuleName="Microsoft.Graph.Applications"; ModuleVersion="2.0.0" } | |
function Get-ApplicationWithExpiratingClientSecret | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Mandatory=$true)] |
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com" -ClientId $env:O365_CLIENTID -Thumbprint $env:O365_THUMBPRINT -Tenant $env:O365_TENANTID | |
Invoke-PnPSPRestMethod -Method Get -Url "https://tenant-admin.sharepoint.com/_api/StorageQuotas()?api-version=1.3.2" | Select-Object -ExpandProperty value | |
GeoAllocatedStorageMB : 0 | |
GeoAvailableStorageMB : 2828400 | |
GeoLocation : NAM | |
GeoUsedStorageMB : 12176 | |
QuotaType : 0 | |
TenantStorageMB : 2840576 |
function ConvertTo-PlaintextString | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Mandatory=$true)][string]$EncryptedPassword, | |
[parameter(Mandatory=$true)][System.Security.Cryptography.X509Certificates.X509Certificate2]$Certificate | |
) | |
begin |
$domain = "contoso.com" | |
Invoke-WebRequest -Uri "https://login.windows.net/$domain/v2.0/.well-known/openid-configuration" | ConvertFrom-Json | |
<# | |
token_endpoint : https://login.windows.net/1316cd1f-b0c7-4253-a7f3-ccc9041aaag9/oauth2/v2.0/token | |
token_endpoint_auth_methods_supported : {client_secret_post, private_key_jwt, client_secret_basic} | |
jwks_uri : https://login.windows.net/1316cd1f-b0c7-4253-a7f3-ccc9041aaag9/discovery/v2.0/keys | |
response_modes_supported : {query, fragment, form_post} | |
subject_types_supported : {pairwise} |
# .\nuget.exe install Microsoft.SharePoint.Client | |
Add-Type -Path "C:\Microsoft.SharepointOnline.CSOM.16.1.8029.1200\lib\net45\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Microsoft.SharepointOnline.CSOM.16.1.8029.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll" | |
# .\nuget.exe install Microsoft.IdentityModel.Clients.ActiveDirectory | |
Add-Type -Path "C:\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
Add-Type -Path "C:\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12 |
Add-PSSnapin Microsoft.SharePoint.PowerShell | |
<# | |
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. | |
THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, | |
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | |
We grant you a nonexclusive, royalty-free right to use and modify the sample code and to reproduce and distribute the object | |
code form of the Sample Code, provided that you agree: | |
(i) to not use our name, logo, or trademarks to market your software product in which the sample code is embedded; | |
(ii) to include a valid copyright notice on your software product in which the sample code is embedded; and |
Add-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll" | |
Add-Type -Path "C:\Microsoft.SharePointOnline.CSOM.16.1.6008.1200\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll" | |
function New-ClientContext | |
{ | |
[cmdletbinding()] | |
param | |
( | |
[Parameter(Mandatory=$true)][System.Uri]$Uri, |