Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
135 views

I'm exploring Pester for unit testing my PowerShell scripts, and I'm running into a mocking issue. I dot-source my functions like this: . "$PSScriptRoot\tz-docker.functions.ps1" But my ...
Tech with Thiru's user avatar
0 votes
1 answer
59 views

I have a PowerShell function that updates IIS configuration. I want to write Pester unit tests for the function. However, the function doesn't return a value and doesn't set a value that's ...
Simon Elms's user avatar
  • 20.4k
4 votes
1 answer
124 views

I have a PowerShell script for setting up a website in IIS. It includes the following function: function Set-IisWebsiteBinding ( [Parameter(Mandatory = $true)] [string]$SiteName, [...
Simon Elms's user avatar
  • 20.4k
-1 votes
2 answers
1k views

I am finishing setting up a PowerShell Module and I have set a series of 5 Pester tests that pass locally but not on GitHub actions. I wonder that may be due to restrictions on the creation of files ...
Pulsares's user avatar
1 vote
1 answer
192 views

I am receiving the following error when trying get this pester test to work for a function that receives a pipeline parameter. "An error occured running Pester: The input object cannot be bound ...
Kurtis's user avatar
  • 37
1 vote
1 answer
98 views

I wrote the following MyTypes module with a simple Class: class Person { [string] $Name Person([string] $name ) { $this.Name = $name } } Then I defined the following MyModule ...
Kurtis's user avatar
  • 37
1 vote
1 answer
36 views

I have been unable to get the mock for New-Object to work. Below is the function and the test inline. Import-Module ImportExcel -Force function Clear-ExcelWorksheet { [CmdletBinding()] param (...
Kurtis's user avatar
  • 37
2 votes
2 answers
112 views

In Pester I need to mock a pipeline function that creates a hashtable in the begin block, updates it in the process block, and returns it in the end block. I thought it would be a simple case of ...
Simon Elms's user avatar
  • 20.4k
0 votes
0 answers
142 views

I am using VS Code for my PowerShell development. I have version 5.1 of PowerShell and version 1.95.3 of VS Code. I have the Pester extension installed in VS Code (version v2023.7.7). Until recently, ...
gerard's user avatar
  • 1,038
0 votes
1 answer
50 views

I am working on some unit tests for a powershell module and I am at a loss for how to test if the Set-NetfirewallProfile was called with the correct parameters. It seems that I am not correctly ...
Aesonus's user avatar
  • 87
0 votes
1 answer
191 views

I would like to mock New-AzStorageContext to return a value that can be used as the DestContext parameter of the function Start-AzStorageBlobCopy. I have tried New-MockObject of Microsoft.WindowsAzure....
Tim Bassett's user avatar
  • 1,238
0 votes
0 answers
367 views

I have written automated tests using PowerShell Pester Framework. We have Azure DevOps for project management and I have the same TCs written in Test Plans -> Test Suites. We also are running the ...
Srikant Kanchumurthi's user avatar
0 votes
1 answer
112 views

Pester 5.6.1 Powershell 7.4.5 Here's the deal. I have data that I am loading in the BeforeDiscovery. I can reference all the variables within at the Run stage...no problem there. Even the string ...
Scott Newman's user avatar
0 votes
1 answer
127 views

I dont understand why I cant test my Read-VaultSecret. in my file appsettings.psm1, i have a this function function Read-VaultSecret($vault, $secretId) { try { return Read-SecureString((...
KingBain's user avatar
  • 109
0 votes
1 answer
74 views

This Pester test: BeforeAll { function Get-HtmlFileDetail { param ( [string[]]$Path = 'E:\Domains', [string[]]$Include = 'Alive*.html' ) return Get-...
bravogolfgolf's user avatar

15 30 50 per page
1
2 3 4 5
23