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
1
vote
1 answer

How can I reload modules from one open work environment to affect another working environment

I have my PowerShell project broken into modules. But because they are modules I have to reload them every time I change them. So I wrote a loop that has a FileSystemWatcher and if one of the .psm1 file changes it will either reload or import that…
pghtech
  • 3,642
  • 11
  • 48
  • 73
1
vote
3 answers

How can I have a parent script but maintain separation of concerns with Powershell Scripts?

So I am working on some IIS management scripts for a specific IIS Site setup exclusive to a product to complete tasks such as: - Create Site - Create App Pool - Create Virtual directories The problem, is I would like to keep separate scripts for…
pghtech
  • 3,642
  • 11
  • 48
  • 73
1
vote
2 answers

How to create dynamic block in powershell, that calls script functions?

I'm trying to generate a dynamic UI. I haven't been able to add an OnClick event dynamically. Here's a sample function Say-Hello { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [String]$name ) …
tamir
  • 81
  • 2
  • 9
1
vote
2 answers

How do I read the "using module" statements in a powershell script?

Powershell 5 has a nice declarative "using module" statement that can be provided at the top of a file to declare the dependencies of the script. Presumably one should be able to use this programmatically to determine what the dependencies of a…
Pxtl
  • 880
  • 8
  • 18
1
vote
1 answer

Displaying logs from when calling external commands from a powershell script

In a powershell module there is a class with the following method (here simplified). It simply calls docker to automatically build an image. Everything works and the image is correctly built. What I cannot understand is why the logs from docker are…
Franco Tiveron
  • 2,364
  • 18
  • 34
1
vote
0 answers

Adding tab completion to the ItemType parameter of "New-Item" for a custom PowerShell provider

I am creating a custom PowerShell provider using PowerShellStandard.Library. When implementing the New-Item cmdlet, I would like to be able to provide support for argument completion of the -ItemType parameter. I cannot find any documentation from…
1
vote
1 answer

Is it possible to Install-Module from public GitHub Packages location?

I have been able to successfully publish a PowerShell module of my own creation to the repo's GitHub Packages location. I have utilized several resources to get that accomplished. The problem comes in after that. I cannot seem to be able to run…
1
vote
1 answer

How to run my PowerShell module cmdlet as SYSTEM?

Created a PowerShell module, it has a function and exposes a cmdlet for that function. the built-in PowerShell 5.1 and pwsh.exe 7.3.1 (Installed using MSI installer) can detect and run the cmdlet without problem. now I need that cmdlet to "run…
1
vote
2 answers

Powershell Module name

I am working on a powershell module that has many cmdlets. I've been asked if we can add something to the cmdlets to prevent namespace collisions between modules. One thing that has been proposed if we could add something before the verb. ex. dotnet…
mituw16
  • 5,126
  • 3
  • 23
  • 48
1
vote
1 answer

Powershell script from Docker Container

I am trying to run a simple powershell script from a docker container. The script is supposed to create an AD group. The problem I am facing is that the ActiveDirectory module is not available, which is why commands such as "New-ADGroup" are not…
1
vote
0 answers

Why do I have to open a new powershell window to get the changes to my psm1 files?

I've written some code in powershell modules, and when my .ps1 file Imports them, it works with a fresh window; but if I stop the script, make some changes to the modules, and re-run the script...for some reason it runs just like it did before the…
leeand00
  • 25,510
  • 39
  • 140
  • 297
1
vote
1 answer

Offline PowerShell module installation failure (PowerCLI)

I've seen numerous posts on the subject but none that offered a solution to my specific case so trying here. I am trying to install VMWare's PowerCLI module into PowerShell on an offline Windows 10 box (21H1). I already obtained the unpacked…
mmysliwiec
  • 21
  • 4
1
vote
0 answers

How can I execute an unexported module function in PowerShell?

I have a module that I'm working on that only exports a few of its functions. For testing, I sometimes want to execute unexported module functions (or read $script: variables, etc). How can I do that (without exporting those functions)? Disclaimer:…
citelao
  • 4,898
  • 2
  • 22
  • 36
1
vote
1 answer

File Explorer won't display PowerShell Modules directory otherwise visible in $env:psmodulepath

I'm in the process of learning how to create powershell modules through this youtube tutorial https://www.youtube.com/watch?v=yKstEJKdc4o&t=3661s - the video itself is not important. I learned from learn.microsoft.com that powershell will have the…
1
vote
0 answers

Cant import a module due to "Import-Module : Could not load file or assembly" however the file is present

Cant import the module due to the error below, but that file is present. C:\Users\User.Name> Import-Module AWS.Tools.S3 Import-Module : Could not load file or assembly…