Questions tagged [powershell-module]

Powershell Modules are sets of related Windows PowerShell functionalities that can be dynamic or persist on disk. Modules can contain cmdlets, providers, functions, variables, aliases and PowerShell drives.

A Powershell Module is a set of related Windows PowerShell functionalities that can be dynamic or persist on disk. Modules that persist on disk are referenced, loaded, and persisted as script modules, binary modules, or manifest modules.

Related Cmdlets

  • ImportSystemModules
  • New-Module
  • Import-Module
  • Export-ModuleMember
  • Get-Module
  • Remove-Module
  • New-ModuleManifest
  • Test-ModuleManifest
203 questions
2
votes
2 answers

How do I redirect Console Output to PowerShell Output within a module?

If I'm writing a binary PowerShell module and I happen to use a .NET library that writes to STDOUT (Console.Out) -- is there a recommended approach to reroute the console output to PowerShell's Output stream? I can intercept the Console.Out by…
E Bekker
  • 436
  • 6
  • 9
2
votes
1 answer

Create adalsql.dll Azure Automation Module (The module was expected to contain an assembly manifest)

I need to use the adalsql.dll in Azure Automation so I can connect to Azure SQL via the Active Directory Password Authentication mode. See this post for details: Active Directory Password Connection Azure SQL Failure from Azure…
Kode
  • 3,073
  • 18
  • 74
  • 140
2
votes
0 answers

Exposing powershell Type Definition from module

I have been testing a new PowerShell module locally, which has several functions and a couple of custom TypeDefinitions that are consumed by other modules. One type I define is for the Verbosity: Add-Type -TypeDefinition @" public enum…
Luke Duddridge
  • 4,285
  • 35
  • 50
2
votes
1 answer

How do I find out a PowerShell module's ArgumentList?

I'm trying to write a script that needs to be detect what the ArgumentList of a PowerShell module is. Is there any way of finding this out? The end game is to be able to use this to create a simple DI container for loading modules.
Daniel Gee
  • 101
  • 8
2
votes
3 answers

Powershell - Export-ModuleMember doesn't work

I'm new with PowerShell and I've just started to create my own module. I created the script & manifest files and placed them into the directory C:\Program Files\WindowsPowerShell\Modules\ who is one listed of the $env:PSModulePath command. I can…
Mica
  • 159
  • 1
  • 10
2
votes
1 answer

How to include functions in script files into PowerShell module

I'm using PowerShell 5.0 and trying to write a multi-files module. The module's folder structure looks like this: /FooModule --- FooModule.psd1 --- FooModule.psm1 --- AnotherScriptFile.ps1 The manifest file FooModule.psd1 is customized like…
wontasia
  • 522
  • 1
  • 6
  • 10
2
votes
1 answer

How to troubleshoot the module nesting limit has been exceeded error in PowerShell V5?

Just installed management framework 5 production preview, my profile won't load anymore with the following error Get-Module : Cannot load the module 'UserInfo.psm1' because the module nesting limit has been exceeded. Modules can only be nested …
Loïc MICHEL
  • 24,935
  • 9
  • 74
  • 103
2
votes
2 answers

Add type during Import-Module

Is there anyway in PowerShell to Add-Type when importing a module? I have a custom VB DLL that I'm importing as a module. The DLL has 2 imports in it: Imports Microsoft.ConfigurationManagement.ManagementProvider Imports…
Shovers_
  • 497
  • 2
  • 13
2
votes
0 answers

Having trouble installing WinSCP PowerShell module

I'm trying to use the WinSCP PowerShell module on a Windows 7 system. This is what I've done: Installed Windows PowerShell version 5.0. Installed Windows Management Framwork v5.0 Started PowerShell as Administrator Executed command…
Dan Stevens
  • 6,392
  • 10
  • 49
  • 68
2
votes
1 answer

Where can I find the dll of binary DSC resources?

I want to extend the original File DSC resource to add support for ensuring that files not present in the source are deleted in the destination. To do this, I'd like to know at least how the original one is implemented by checking it's code on a…
julealgon
  • 7,072
  • 3
  • 32
  • 77
2
votes
1 answer

PowerShell: Modules, their locations, and reloading

I have a pretty straightforward PS script, that refers to a bunch of self written modules (psm1). When I run my script from PowerShell ISE I am often pulling my hair out because due to the fact that the latest version of my module is not executed…
bas
  • 13,550
  • 20
  • 69
  • 146
2
votes
2 answers

Using script scope modifier on PowerShell functions in modules has no effect?

I assumed that using the script scope modifier on a function in a PowerShell module would prevent the function from being exported. Sample: function script:Get-One { 1 } When I import the module the Get-One function is exported. Questions Is it…
knut
  • 4,699
  • 4
  • 33
  • 43
2
votes
2 answers

Powershell modules in scheduled task

There is something about modules I don't quite get.... If I as a normal user do get-module -listavailable I get a result like this: Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules ModuleType Name …
Stig
  • 87
  • 3
  • 14
2
votes
1 answer

How do I return a value or object from a C# PowerShell command to PowerShell?

I am using a C# library (.NET 4) with the System.Management.Automation DLL file to implement some commands for PowerShell (2.0). I need to get a value from a command in a PowerShell script. [Cmdlet(VerbsCommon.Get, "MyCommand")] public class…
1
vote
1 answer

Need FileSystemWatcher Event to reload modules in current working environment

First off, I have a similar question here, but didn't have a direction on solving the problem. With an idea from a poster Andy Arismendi I come up with a possible solution and this is a new problem: I am running the below script which binds the…
pghtech
  • 3,642
  • 11
  • 48
  • 73