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 all webpart or control information from all pages in a SharePoint site to CSV format | |
### | |
$outputfilepath = "<Output fodler>\webparts.csv" | |
$weburl = "https://contoso.sharepoint.com" | |
#Validate login in | |
$m365Status = m365 status | |
if ($m365Status -eq "Logged Out") { | |
m365 login | |
} |
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
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); | |
} else { |
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
/* **** RUN THIS SNIPPET in Browser Developer Console to see the output **** */ | |
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); |
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
/* **** RUN THIS SNIPPET in Browser Developer Console to see the output **** */ | |
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); |
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
Write-Host '****** Export All Flow run histories into CSV ******' | |
#Provide Ouput Folder Path | |
$outputPath = "<Output Folder Path>" | |
$timestamp = Get-Date -Format "yyyymmddhhmmss" | |
$flowhistoryValues = @() | |
$environmentId = $(m365 flow environment list --query "[?contains(name,'Default')]" -o json | ConvertFrom-Json).Name | |
$flows = m365 flow list --environment $environmentId -o json | ConvertFrom-Json |
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 in bash | |
----------------------- | |
npm un -S @types/webpack-env @types/es6-promise | |
npm un -D @types/chai @types/mocha | |
npm i -SE @microsoft/sp-core-library@1.12.1 @microsoft/sp-lodash-subset@1.12.1 @microsoft/sp-office-ui-fabric-core@1.12.1 @microsoft/sp-webpart-base@1.12.1 @microsoft/sp-property-pane@1.12.1 | |
npm i -DE @microsoft/sp-build-web@1.12.1 @microsoft/sp-module-interfaces@1.12.1 @microsoft/sp-webpart-workbench@1.12.1 @microsoft/sp-tslint-rules@1.12.1 gulp@4.0.2 @microsoft/rush-stack-compiler-3.7@0.2.3 @types/webpack-env@1.13.1 @types/es6-promise@0.0.33 | |
npm dedupe | |
rm ".editorconfig" | |
./config/copy-assets.json |
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 all lists properties (Specified in $listProperties variable) from the SharePoint in to CSV format | |
### | |
$outputfilepath = "<PUTYOURPATHHERE.csv>" | |
$weburl = "https://contoso.sharepoint.com/" | |
# Provide List Properties in below variable | |
$listProperties = @('Title', 'Url', 'Id') | |
### | |
Write-host 'ensure logged in' | |
$m365Status = m365 status | |
if ($m365Status -eq "Logged Out") { |
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
Write-host 'ensure logged in' | |
$m365Status = m365 status | |
if($m3656Status -eq "Logged Out"){ | |
m365 login | |
} | |
#Initialize variables | |
$siteUrl ='https://contoso.sharepoint.com' | |
$library ='Documents' |
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
//Try this code in Microsoft Power Automate Home page | |
function getRequest(url) { | |
var request = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
request.onreadystatechange = function() { | |
if (request.readyState !== 4) return; | |
if (request.status >= 200 && request.status < 300) { | |
resolve(request); | |
} else { |
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 getRequest(url) { | |
var request = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
request.onreadystatechange = function() { | |
if (request.readyState !== 4) return; | |
if (request.status >= 200 && request.status < 300) { | |
resolve(request); | |
} else { | |
reject({ | |
status: request.status, |