Questions tagged [pssnapin]

PowerShell snap-ins provides a mechanism for registering sets of cmdlets and another Windows PowerShell provider with the shell. May also refer to the PSSnapIn base class.

A Windows PowerShell snap-in provides a mechanism for registering sets of cmdlets and another Windows PowerShell provider with the shell, thus extending the functionality of the shell. A Windows PowerShell snap-in can register all the cmdlets and providers in a single assembly, or it can register a specific list of cmdlets and providers.

All Windows PowerShell snap-in classes derive from the PSSnapIn or CustomPSSnapIn classes.

Related Cmdlets

  • Add-PSSnapin
  • Remove-PSSnapin
  • Get-PSSnapin
45 questions
13
votes
7 answers

C# Powershell snapin not registering using installutil

I've got a really simple powershell script (see below). I've got installutil aliased using the following in my profile: set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil In powershell I simply: installutil…
downatone
  • 1,906
  • 2
  • 23
  • 30
12
votes
3 answers

No snap-ins have been registered for Windows PowerShell version 2

I am trying to run a Powershell script on a web server where SQL Server Management Studio is not installed but all pertinent packages from the Microsoft SQL Server 2008 R2 SP2 Feature Pack have been installed. You need to install those small bits…
crackedcornjimmy
  • 1,752
  • 2
  • 22
  • 33
6
votes
2 answers

Run Exchange Powershell command from C#

I am trying to run EMC commands in C#. I am running this from my personal PC that has exchange management tools installed on it. Our exchange servers have 2007 running on them. The thing is, when I run Powershell or EMC, I need to run as a…
Johnrad
  • 2,487
  • 16
  • 53
  • 91
6
votes
1 answer

What is the difference between Add-PSSnapin and Import-Module in PowerShell?

Possible Duplicate: What’s the difference between Add-PsSnapIn and Import-Module What is the difference between Add-PSSnapin and Import-Module in PowerShell? At the end, both seem like they provide the same result. Which one is the recommended…
Samselvaprabu
  • 13,922
  • 28
  • 113
  • 200
5
votes
1 answer

Add Powershell Snapin for Powershell Module and Import Multiple Times

I would like to use the SqlServerCmdletSnapin for my custom Powershell Commandlet I am building. If I add the following code to the beginning of my PSM1: if ( (Get-PSSnapin -Name sqlserverprovidersnapin100 -ErrorAction SilentlyContinue) -eq $null…
Blake Blackwell
  • 6,947
  • 9
  • 45
  • 67
4
votes
3 answers

PowerShell - Distributed Solution

I'm new to PS so I may get some of the terminology wrong. If you want to roll out a custom PowerShell environment (snap-in) for a team of 30 developers/DBAs. What is the best way to do this... if you intend to be rolling out new functionality once a…
BuddyJoe
  • 64,613
  • 107
  • 281
  • 451
4
votes
6 answers

how to create a cmdlet?

I have written my program in c# .net. I want to convert it in to a powershell cmdlet. I was instructed to use pssnapin and getproc programs. Can anyone plz help me out.. Regards Arun
Arun
  • 570
  • 6
  • 11
  • 16
4
votes
1 answer

ImportPSModule Failure Detection

I am trying to use InitialSessionState.ImportPSModule in order to import a Powershell module. I am interested in knowing if importing of the module failed due to any reason (e.g file not found etc.). Putting such code in the try block does not…
Dev28
  • 487
  • 3
  • 14
3
votes
2 answers

Is Make-Shell deprecated?

A couple of years ago I used Make-shell to create custom shells with custom cmdlets. Later I used snap-in technique and I forgot about that option. Now I should deploy a set of custom cmdlets to a big set of customers, and it would be better to…
fra
  • 2,295
  • 4
  • 34
  • 59
3
votes
2 answers

Load-Module equivalient in PowerShell v1

For reasons of script portability, I need to dynamically load snap-ins in a PowerShell script. This is easily accomplished in PowerShell v2 with the Load-Module function. I need to run this particular script on a machine where I, for various…
friism
  • 18,110
  • 5
  • 72
  • 114
3
votes
2 answers

PowerShell Snapin Cmdlet CommandNotFoundException

Currently I'm trying to create my first PowerShell Snapin. I followed this tutorial: How to create a PowerShell Snapin and everything works fine until I'm trying to invoke my custom cmdlet. In addition I added a "Post Build Event" to register the…
Kevin Goedecke
  • 940
  • 9
  • 24
2
votes
1 answer

Custom PowerShell Snapin: custom format doesn't work

I used this article to write my first own Powershell Cmdlet and Snapin. And it works fine. But I return a set of objects from my own data class, which has four properties and I want Powershell to display just one of these properties by default. So I…
Hinek
  • 8,900
  • 12
  • 48
  • 71
2
votes
0 answers

Importing remote PowerShell commands into a friendly named module

I've managed to use Import-PSSession to create proxies to PowerShell commands (Modules, SnapIns, etc). It seems to work fine, but the syntax to avoid name collisions doesn't feel very natural. I have a 3rd party PowerShell SnapIn containing the…
Rob
  • 4,015
  • 4
  • 27
  • 48
1
vote
2 answers

No installers found when running install util on custom pssnapin

I created a very simple PSSnapin but when I go to run IntallUtil against the assembly I get the following: No public installers with the RunInstallerAttribute.Yes attribute could be found in the…
devlife
  • 13,287
  • 23
  • 70
  • 126
1
vote
1 answer

Powershell 5.1 snap in registration errors

To preface this, this script i made that involves creating 2007 MS Exchange mailboxes had worked a week or two ago, and suddenly gave me an error (below) from this: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin error…
toupin
  • 11
  • 1
  • 3
1
2 3