0
我可以使用下面一行加载System.Windows.Forms的:负载的SharePoint大会在PowerShell中
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
$openFile = New-Object System.Windows.Forms.OpenFileDialog
但不能使用类似的行脚本加载的SharePoint组件:
[reflection.assembly]::loadwithpartialname("Microsoft.SharePoint.Publishing") | Out-Null
$obj = New-Object Microsoft.SharePoint.Publishing.Design
获得以下错误:
New-Object : Cannot find type [Microsoft.SharePoint.Publishing.Design]: verify that the assembly containing this type is loaded`.
我在做任何错误。与Add-Type相同。
非常感谢。这确实帮助了很多...... –