Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
74 views

I specified the PSModulePath in %ONEDRIVE%\Documents\PowerShell\powershell.config.json and then restarted the computer. A new PowerShell session showed the custom PSModulePath via $env:PSModulePath ...
a5yyc's user avatar
  • 43
1 vote
1 answer
63 views

Let's assume I am calling a script called script.ps1 It loads a module called DoStuff, it calls the Do-WorkPart1 cmdlet from that module Inside DoWork.psm1 file that is part of the manifest, I want to ...
deetle's user avatar
  • 437
2 votes
2 answers
141 views

The manifest variable export VariablesToExport = @( "ERROR_SUCCESS_REBOOT_REQUIRED", "ERROR_SUCCESS", "ERROR_INVALID_FUNCTION", "...
deetle's user avatar
  • 437
0 votes
0 answers
37 views

cmdlets that are used by customer of this module will need to be exported. 2 files file1.ps1 function Yes() { DoSomthing } file2.ps1 function DoSomthing() { } Ass DoSomthing is called from file1 ...
deetle's user avatar
  • 437
1 vote
1 answer
63 views

In the script module, with 98 ps1 filles. Each file had access to each cmdlet from each file without needing to explicitly export them. But in the manifest module, only the cmdlets that have been ...
deetle's user avatar
  • 437
0 votes
0 answers
44 views

I am converting a script module to a manifest module. In the script module I do the below at the end # # Whole module Verbose output # # We will output verbose "Continue" # We will NOT ...
deetle's user avatar
  • 437
0 votes
0 answers
35 views

If I publish my C# Binary PowerShell module like this, it works. dotnet publish -c Release Push-Location ".\Module\bin\Release\net7.0\publish" Publish-Module -Name .\ImportIcal.psd1 -...
Craig.C's user avatar
  • 621
0 votes
1 answer
25 views

I have a script like this, in a classes.psm1 file: class A { A([string] s) { } } class B : A { B([string] s) : base($s) } Then I try to import it in a .ps file: using module classes.psm1 ...
mike's user avatar
  • 496
-3 votes
1 answer
123 views

How to get a list of PowerShell functions in a newly installed PowerShell package from the PowerShell Gallery? I just installed a package via Install-Module -Name ModuleName. I would like to be able ...
Dan's user avatar
  • 2,573
1 vote
1 answer
101 views

When importing a module fails, it will still load the RequiredModules defined in the .psd1 manifest. Consider the following module files: MyModule.psd1 @{ RootModule = 'MyModule.psm1' ...
Paul π's user avatar
  • 585
0 votes
0 answers
1k views

I would like to install the UIAutomation PowerShell module on my PowerShell ISE. I have used the following command for this: Install-Module -Name UIAutomationClient or Install-Module -Name ...
JamieFromTheFunnyGuys's user avatar
0 votes
1 answer
525 views

In Windows PowerShell (version 5.1.19041.4894) what should I do to have modules loaded? This is in the $Env:PSModulePath: D:\Users\theking2\OneDrive\Documents\WindowsPowerShell\Modules;..... The ...
theking2's user avatar
  • 3,100
1 vote
1 answer
154 views

I have a .psm1 module file that has a few helper functions for the run.ps1 script. In one of the functions, I'm accessing Azure Key Vault to grab a connection secret; this is where the run.ps1 seems ...
James 's user avatar
  • 11
2 votes
2 answers
110 views

PS C:\> Get-PSSubsystem causes error Get-PSSubsystem: The term 'Get-PSSubsystem' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the ...
joseville's user avatar
  • 1,023
0 votes
1 answer
435 views

I have a PowerShell module written in C#. I have a "Assets" directory with some files as part of the module. When I publish the module to a local directory, it has structure like this: |- ...
Petr's user avatar
  • 354
0 votes
0 answers
270 views

I am trying to setup a PowerShell repository for private modules on Artifactory based on this article: https://jfrog.com/help/r/how-to-work-with-powershell-modules-and-nuget-repository/how-to-work-...
Mickey Cohen's user avatar
  • 1,307
1 vote
1 answer
153 views

I have a small PowerShell module that loads fine without a psd1 file. As soon as a psd1 file is in the root of the module folder, the module fails to (auto) load without error. Also Test-...
theking2's user avatar
  • 3,100
1 vote
1 answer
1k views

Uninstalled the old PS module, downloaded the nuget package for the new 22.2 SqlServer, copied the files over the server which is offline, extracted the files into the modules folder but SQL Server is ...
Stackoverflowuser's user avatar
1 vote
1 answer
587 views

I have the following directory structure: └─ScriptModuleRepositoryTemplate │ ScriptModuleRepositoryTemplate.psd1 │ ScriptModuleRepositoryTemplate.psm1 │ ScriptModuleRepositoryTemplate....
deadlydog's user avatar
  • 24.8k
2 votes
1 answer
2k views

I have a PowerShell module written in C#. Recently I upgraded it to .NET 8. My project file looks like this: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <...
Petr's user avatar
  • 354
1 vote
2 answers
326 views

I am trying to use a custom PowerShell module in an Azure Automation account. I have prepared the module and tested it locally. It is loaded and the commands can be used. However, when I pack and ...
magichappenz's user avatar
1 vote
0 answers
262 views

I am trying to use [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] as follows: $authContext = [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]$authUrl ...
Melissa's user avatar
  • 255
1 vote
1 answer
181 views

There seems to be some issue with the PowerShell Command Get-InstalledModule. E.g When I log in locally to a Windows server (PowerShell 5.1) and execute command Get-InstalledModule -Name Az it works ...
Ajay Pawar's user avatar
2 votes
1 answer
606 views

So I finally finished building a class/type but now I am stumped on how to actually deploy it at the places I need. The class is supposed to provide a general purpose type, called Filmcode. I have a ...
Ralf_Reddings's user avatar
0 votes
1 answer
390 views

Working on a PowerShell module and noticed I'm having an issue when attempting to import it, no matter how import-Module -Name ".\0.0.1\PSSymantecSEPM.psd1" -Force An error occurred while ...
Douda's user avatar
  • 308
1 vote
1 answer
286 views

Currently, I have a number of *.ps1 Cmdlet files, each providing a different function, e.g.: Encode-File.ps1 Decode-File.ps1 Now, I want to convert these into a single module, so I can have their ...
AxD's user avatar
  • 3,262
2 votes
1 answer
161 views

I'm working on a project, where I use the input properties to create parameters on objects with strong types. I have this sample code: using System; using System.Management.Automation; using System....
Axel Andersen's user avatar
1 vote
1 answer
1k views

I want to use the Get-ADUser module to retrieve data from the AD domain. Non-Administrator permissions in the directory are sufficient to perform that action. Locally, Administrator permissions are ...
Michael B. Ortiz's user avatar
3 votes
1 answer
183 views

I have a module PhriInfrastructure which codifies our DevOps procedures at my organization. It has a function Test-IsLocalhost that I've aliased to Get-IsLocalhost for backwards-compatibility reasons....
Pxtl's user avatar
  • 1,053
3 votes
2 answers
440 views

I am creating a PowerShell module that defines a class. For example: class MyClass { [string] $Name } If I put the class definition directly in the psm1 file then everything works fine. However, ...
deadlydog's user avatar
  • 24.8k
1 vote
3 answers
484 views

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)] [...
tamir's user avatar
  • 99
1 vote
2 answers
130 views

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 ...
Pxtl's user avatar
  • 1,053
1 vote
3 answers
2k views

The Problem: I have inherited a PS script file that deletes a directory. In case there are any locks on it, it removes them using this line: Get-SmbOpenFile | Where-Object -Property Path -Like "$(...
nvoigt's user avatar
  • 77.8k
0 votes
0 answers
56 views

I have a Powershell module ExportHelper.psm1 in which I define a custom class Text and a function Add-Text: class Text { [string]$value [Format]$format } function Add-Text { Param([Text]$text) ...
Hester's user avatar
  • 143
1 vote
1 answer
32 views

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 ...
Franco Tiveron's user avatar
0 votes
1 answer
430 views

I am using the PowerShell module ImportExcel from here: https://github.com/dfinke/ImportExcel To eliminate my complex code I am just running the following: (xxx indicates folders I dont want to show) $...
RuSs's user avatar
  • 1,822
0 votes
0 answers
64 views

Is it possible to import the Exchange OnPrem and Exchange Online modules into a single runspace? I've been trying the below and then only receiving the on prem data? I want to ensure that I'm not ...
Bbb's user avatar
  • 721
1 vote
0 answers
72 views

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 ...
Philipp Naused's user avatar
0 votes
0 answers
14 views

While fetching the data from the excel through the PowerShell, along with that we are getting the column heading and datatype is "PSCustomObject". so can any one help to remove the column ...
chandra_sekhar's user avatar
1 vote
1 answer
2k views

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 ...
B. Witter's user avatar
  • 664
5 votes
1 answer
4k views

We learn that Powershell introduced Module Auto-Loading in 3.0 : ... PowerShell imports modules automatically the first time that you run any command in an installed module. You can now use the ...
Martin Ba's user avatar
  • 39.4k
1 vote
1 answer
5k views

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 ...
user avatar
0 votes
1 answer
640 views

I am creating a module which contains a class file as well as a unit test file (Pester). The class B in the class file inherits from a class A found in another module. If I try to run a unit test that ...
Rye bread's user avatar
  • 1,901
0 votes
1 answer
3k views

I want to install the Powershell Module MicrosoftPowerBIMgmt with below command line: Install-Module -Name MicrosoftPowerBIMgmt However, the script is executed, but it may be limited by my network, ...
Joy's user avatar
  • 945
3 votes
1 answer
873 views

I have a custom Powershell module I have been working on for the past few days, I am now trying to integrate it into powershell as a module that always gets auto loaded. My module is placed under the ...
hellen_dorandt89's user avatar
3 votes
3 answers
2k views

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 ...
mituw16's user avatar
  • 5,278
0 votes
0 answers
309 views

I have seen this question here but there not working for me. I currently have taken apart a psm1 file with 200 functions and separated them into individual files. Functions are separated into public ...
Leo Torres's user avatar
1 vote
1 answer
1k views

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 ...
Alberto Molina's user avatar
0 votes
2 answers
2k views

I am trying to shutdown the VM using Azure Automation Account System Managed identity option. However I am ending up with below error. As per the other articles it is mentioned to upgrade the module ...
Uday Kiran's user avatar
1 vote
0 answers
28 views

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 ...
leeand00's user avatar
  • 26.6k

1
2 3 4 5