Created
October 18, 2017 18:34
-
-
Save joerodgers/763b5d7f8d6212d293f6f9bd35581f76 to your computer and use it in GitHub Desktop.
Loads all of the CSOM assemblies into the current PowerShell process
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 Import-ClientSideObjectModelAssemblies | |
{ | |
[cmdletbinding()] | |
param | |
( | |
[Parameter(Mandatory=$true)][string]$AssemblyPath | |
) | |
begin | |
{ | |
} | |
process | |
{ | |
Get-ChildItem -Path $AssemblyPath -ErrorAction Stop | ? { $_.Name -match "Microsoft.*.dll" -and $_.Name -notmatch ".Runtime.Windows.dll" } | % { | |
[System.Reflection.Assembly]::LoadFrom( $_.FullName ) | Out-Null | |
} | |
} | |
end | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment