This file contains hidden or 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
| (async () => { | |
| console.log('starting...'); | |
| const webUrl = '<weburl>' | |
| if (!window.SP) { | |
| for (const src of ['init.js','MicrosoftAjax.js','SP.Runtime.js','SP.js','sp.workflowservices.js']) { | |
| await new Promise(done => { | |
| const script = document.createElement('script'); | |
| script.async = true; |
This file contains hidden or 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
| (async () => { | |
| console.log('starting...'); | |
| const webUrl = '<weburl>' | |
| if (!window.SP) { | |
| for (const src of ['init.js','MicrosoftAjax.js','SP.Runtime.js','SP.js','sp.workflowservices.js']) { | |
| await new Promise(done => { | |
| const script = document.createElement('script'); | |
| script.async = true; |
This file contains hidden or 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
| param( | |
| [Parameter(Mandatory = $true)] | |
| [string]$SourceEnv, | |
| [Parameter(Mandatory = $true)] | |
| [string]$DestinationEnv | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| # Note: these values could be loaded from elsewhere, e.g. CSV/XML (or dynamically if you want to get fancy) |
This file contains hidden or 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
| (async () => { | |
| const listId = SP.ListOperation.Selection.getSelectedList()?.replace(/{|}/g,''); | |
| const itemId = SP.ListOperation.Selection.getSelectedItems()?.[0]?.id; | |
| if (!listId || !itemId) { | |
| throw new Error('You havn\'t selected a list item'); | |
| } | |
| const ctx = SP.ClientContext.get_current(); | |
| const web = ctx.get_web(); |
This file contains hidden or 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
| (async () => { | |
| console.log('starting...'); | |
| await new Promise(done => SP.SOD.executeFunc('sp.js', 'SP.ClientContext', done)); | |
| console.log('scripts loaded...'); | |
| SP.ClientContext.prototype.execute = function() { | |
| return new Promise((resolve,reject) => | |
| this.executeQueryAsync(resolve, (sender, args) => reject(args.get_message())) | |
| ); |
This file contains hidden or 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
| (async () => { | |
| console.log('starting...'); | |
| if (!window.SP) { | |
| for (const src of ['init.js','MicrosoftAjax.js','SP.Runtime.js','SP.js']) { | |
| await new Promise((resolve,reject) => { | |
| const scriptEl = document.createElement('script'); | |
| scriptEl.src = `/_layouts/15/${src}`; | |
| scriptEl.addEventListener('load', () => resolve()); | |
| scriptEl.addEventListener('error', () => reject()); |
This file contains hidden or 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
| (async () => { | |
| console.log('starting...'); | |
| await new Promise(done => SP.SOD.executeFunc('sp.js', 'SP.ClientContext', done)); | |
| console.log('scripts loaded...'); | |
| SP.ClientContext.prototype.execute = function() { | |
| return new Promise((resolve,reject) => | |
| this.executeQueryAsync(resolve, (sender, args) => reject(args.get_message())) | |
| ); |
NewerOlder