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
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
  • 15,275
  • 27
  • 77
  • 131
1
vote
0 answers

Snapins loaded from child, not in parent scope when separate files used for Classes

It's a odd example but it gets my issue across: FILE: Foo.psm1 class Foo { [OBJECT] GetSite () { return Get-SPWeb -Identity 'http://mysharepointsite.com'; } } FILE: Bar.psm1 Using MODULE ".\Foo.psm1"; class Bar : Foo { Bar…
Vidarious
  • 746
  • 2
  • 10
  • 22
1
vote
1 answer

Attributes that control cmdlet's Definition

I am creating a number of Powershell cmdlet's and am noticing that after I install my snap-in and execute the following command the parameter data types are listed as single instead of the types programmed (in my case float). get-command -pssnapin…
ChiliYago
  • 11,341
  • 23
  • 79
  • 126
1
vote
1 answer

How can I run initialization code each time my snap-in is loaded?

I have a PowerShell snapin, and I would like to run a bit of initialization code (hooking some AppDomain events) each time my snapin is loaded (i.e. once for each powershell.exe process that is started). How can this be accomplished?
Mark
  • 11,257
  • 11
  • 61
  • 97
1
vote
1 answer

how to write helpfile for powershell snapin

I have developed my custom powershell snapin. I wanted to write help for that. Is anyone aware about any tool? I have already tried ps cmdlet help editor from codeplex (https://pscmdlethelpeditor.codeplex.com/releases/view/573966), but that is not…
mitesh
  • 39
  • 7
1
vote
0 answers

uninstallation of a powershell cmdlet

I created my custom powershell cmdlet. It registers and installs fine, but when I try to uninstall it, I get an error. I use this command to uninstall it: c:\windows\microsoft.net\framework64\v4.0.30319\installutil /u 'path to .dll' Error: The…
user1019042
  • 2,428
  • 9
  • 43
  • 85
1
vote
2 answers

Referencing external assemblies from PowerShell snap-in

I'm developing a custom PowerShell snap-in, which references another project in the solution. When I try to debug the snap-in (following [these instructions][1]), the assembly fails to load and my cmdlet fails with the message "Could not load file…
Paolo Tedesco
  • 55,237
  • 33
  • 144
  • 193
1
vote
1 answer

Best way to store powershell snapin names to be used by c# app for later use

I have a c# app which executes rules, depending on an input. Some of the rules need to execute a poweshell script. I would assume that some of the scripts, as perhaps writtem by a user, would need a snapin to be available before they can execute…
scope_creep
  • 4,213
  • 11
  • 35
  • 64
0
votes
1 answer

Running Powershell 5.1 in a C# / .NET Core 2.1 Application

I'm trying to migrate an application from .NET 4.5 to .NET Core 2.1. This application is using the System.Management.Automation dll to execute powershell commands and scripts. I need to use some PSSnapin from a SDK and i don't know if i can get…
dotdiego
  • 157
  • 3
  • 14
0
votes
1 answer

Path for Add-PSSnapin not correct when running PowerShell Script from C#

I am running PowerShell Scripts from a C# Tool like this: using (PowerShell pshell = PowerShell.Create()) { pshell.AddCommand(scriptFullPath); pshell.AddParameter("username", user); pshell.AddParameter("password", pass); …
Kirschi
  • 1,088
  • 3
  • 12
  • 32
0
votes
2 answers

How to Load Component Services/DCOM Config SnapIn

I have a PS script to do some DCOM configuration. It works fine as long as I have the Component Services/DCOM Config snapin loaded. I want to load that programmatically so I can do all of this as part of an install package. Does anyone know how to…
RGuggisberg
  • 4,630
  • 2
  • 18
  • 27
0
votes
1 answer

Adding a snapin from a module not working like expected

I have the following PowerShell module called module.psm1. This is a simplified example. I am doing actions against SharePoint 2013 so I need the snapin for SharePoint in my module function Test() { if ((Get-PSSnapin…
Danny
  • 746
  • 2
  • 8
  • 20
0
votes
1 answer

Oracle Snapins or modules availability

I need to write a powershell script which runs various commands on an oracle server. Are there Snapins or modules available for oracle like there are for SQL server etc? I did my research but couldn't find anything.
Tushar Yadav
  • 55
  • 1
  • 6
0
votes
1 answer

SQL PowerShell Snapin Problems

I am currently trying to execute the command add-sqlsnappin which give me error message SQL Server Provider for Windows PowerShell is not installed. At…
nano
  • 75
  • 1
  • 12
0
votes
1 answer

Powershell SnapIn when running in Visual Studio publish

I'm trying to run a powershell script when doing a file system publish for my project in Visual Studio, but snap-ins don't seem to be working when actually running the publish. If I run the powershell script manually outside of visual studio the…
SikhWarrior
  • 1,037
  • 5
  • 17
  • 34