Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PowerShell command missing

Posted on 2013-11-11
4
Medium Priority
?
3,118 Views
Last Modified: 2013-11-23
Hi all,

while trying to setup my local sharepoint 2013 on a windows server 2012 box to use app isolation for a high trust app following this guide I get errors.

Context is: running Windows Server 2012, Sharepoint 2013, entering commands in a Sharepoint 2013 Management Shell run as Administrator.

Powershell version:

PS C:\Windows\system32> $PSVERSIONTABLE

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18051
BuildVersion                   6.2.9200.16628
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

Open in new window


Problem:
PS C:\Windows\system32> $publicCertPath = "C:\Users\xyz\Desktop\Bsc
LocalhostCertificate.cer"
PS C:\Windows\system32> $certificate = Get-PfxCertificate $publicCertPath
Get-PfxCertificate : The term 'Get-PfxCertificate' is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:16
+ $certificate = Get-PfxCertificate $publicCertPath
+                ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-PfxCertificate:String) [],
   CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Open in new window


My question now: what do I have to do enable PowerShell / Management Shell to accept Get-PfxCertificate? Some special "Add-PSSnapin"?

Best regards,
Bernd-Christoph Schwede
0
Comment
Question by:BerndChristophSchwede
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 44

Assisted Solution

by:Rainer Jeschor
Rainer Jeschor earned 300 total points
ID: 39638463
Hi Bernd-Christoph,

this is somehow strange as Powershell should load its Microsoft.PowerShell.Security module automatically (when used).

What happens if you enter:
Get-Module

Open in new window

and
Get-Module -ListAvailable

Open in new window


Can you see the security module?

HTH
Rainer
0
 

Author Comment

by:BerndChristophSchwede
ID: 39638721
Hi,

thanks for the pointers. Here's the Get-Module-output:

PS C:\Windows\system32> Get-Module
PS C:\Windows\system32> Get-Module -ListAvailable

ModuleType Name                                ExportedCommands
---------- ----                                ----------------
Manifest   DistributedCacheAdministration      {Connect-AFCacheClusterConfig...
Manifest   DistributedCacheConfiguration       {Get-AFCacheCluster, Get-AFCa...


PS C:\Windows\system32>

Open in new window


Looks a bit compact...and yes, I tried "import module ...":

PS C:\Windows\system32> Import-Module "Microsoft.Powershell.Security"
Import-Module : The specified module 'Microsoft.Powershell.Security' was not
loaded because no valid module file was found in any module directory.
At line:1 char:1
+ Import-Module "Microsoft.Powershell.Security"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.Powershell.Secur
   ity:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Comm
   ands.ImportModuleCommand

Open in new window

Looks too empty to my taste...
0
 

Accepted Solution

by:
BerndChristophSchwede earned 0 total points
ID: 39658705
yuck...solution was: the sharepoint administration shell had missing path elements.
In my case, it should have contained C:\Windows\System32\WindowsPowerShell\v1.0\Modules
- but it didn't...

To test for that:
- locate the relevant cmdlet file on your computer (in my case Microsoft.Powershell.Security.psd1 )
- check $env:PSModulePath to contain the path to the "Moduls" folder above the folder containing the cmdlet file.

Case closed. I'll accept RainerJ's hint as it pointed in the right direction at least...thanks!
0
 

Author Closing Comment

by:BerndChristophSchwede
ID: 39671163
As stated in my comment, RainerJ's comment was pointing deeper to the real problem. Yet the complete solution was still around some more corners...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve DNS query failed errors for Exchange
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question