David Wilson - @daviwil Software Engineer, PowerShell Team
- Visual Studio Code overview
- Configuring the editor
- Extensions
# Inspiration from https://twitter.com/mrhvid/status/929717169130176512 @mrhvid @Lee_Holmes | |
function ResolveIp($IpAddress) { | |
try { | |
(Resolve-DnsName $IpAddress -QuickTimeout -ErrorAction SilentlyContinue).NameHost | |
} catch { | |
$null | |
} | |
} |
David Wilson - @daviwil Software Engineer, PowerShell Team
<# | |
.Synopsis | |
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object. | |
.DESCRIPTION | |
Replicates what you would do with a lambda expression in C#. | |
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes | |
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')". | |
.EXAMPLE | |
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery | |
$web.Fields | select InternalName, Id |
<# | |
.SYNOPSIS | |
Sets the system fields for a specific list/library item. | |
.DESCRIPTION | |
This will set the system fields (created, created by, modified, modified by) | |
for a specific list/library item. | |
Provide any or all of those system fields as a parameter and they will be set. | |
If no modified date is provided, the item keeps its current modified date. |
<# | |
.Synopsis | |
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object. | |
.DESCRIPTION | |
Replicates what you would do with a lambda expression in C#. | |
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes | |
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')". | |
.EXAMPLE | |
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery | |
$web.Fields | select InternalName, Id |
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" | |
Function Ensure-Folder() | |
{ | |
Param( | |
[Parameter(Mandatory=$True)] | |
[Microsoft.SharePoint.Client.Web]$Web, |
. .\TopOfScript.ps1 | |
$rootWeb = $clientContext.Web | |
$childWebs = $rootWeb.Webs | |
$clientContext.Load($rootWeb) | |
$clientContext.Load($childWebs) | |
$clientContext.ExecuteQuery() | |
function processWeb($web) | |
{ |