Hai*_*OUI 6 powershell sharepoint-2013 windows-server-2012
我想为SharePoint中的app dev配置高可信应用程序,最后这样做我需要先在powershell编辑器中插入一些命令,如:
$publicCertPath = "C:\Certs\HighTrustSampleCert.cer"
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($publicCertPath)
Run Code Online (Sandbox Code Playgroud)
我在Windows Server 2012 R2上使用Windows PowerShell,其中包括Windows PowerShell 4,默认情况下包含新对象cmd-let ...但我不明白,为什么我的系统不识别该命令....时间我收到以下错误:New-Object:术语'New-Object'不被识别为cmdlet的名称.
每次打开电源外壳时都会显示以下错误:
*选择 :
术语"选择对象"不被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.在C:\ Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint.ps1:1 char:16 + $ ver = $ host | select version + ~~~~~~ + CategoryInfo:ObjectNotFound:(Select-Object:String)[],逗号ndNotFoundException + FullyQualifiedErrorId:CommandNotFoundException设置位置:术语"设置位置"不被识别为cmdlet的名称,功能,脚本文件或可操作程序.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后再次尝试在C:\ Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint. ps1:4 char:1 + Set-location $ home + ~~~~~~~~~~~~ + CategoryInfo:ObjectNotFound:(Set-location:String)[],Comman dNotFoundException + FullyQualifiedErrorId:CommandNotFoundException*
我认为这是正常的,直到今天......它与错误有任何关系吗?这是洞(新对象)异常堆栈:
New-Object:术语"New-Object"不被识别为cmdlet,函数,脚本文件或可操作程序的名称.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试.在行:1 char:16 + $ certificate = New-Object System.Security.Cryptography.X509Certificates.X509Cert ... + ~~~~~~~~~~ + CategoryInfo:ObjectNotFound:(New-Object:String)[ ],CommandN otFoundException + FullyQualifiedErrorId:CommandNotFoundException
有人可以帮我吗?
ps:我也想提一下,当我使用enter-pssession并远程工作时,命令new-object被识别,但sharepoint命令(如Get-SPAuthenticationRealm)不再被识别......这真的令人困惑.
您的 PowerShell 安装似乎已损坏,需要修复。该New-Object
cmdlet 由Microsoft.PowerShell.Utility
模块导出,该模块是核心 PowerShell 模块之一,默认情况下应在所有 PowerShell 安装上导入。
归档时间: |
|
查看次数: |
10122 次 |
最近记录: |