Skip to content

Commit 89898bf

Browse files
Update PSModule.yml configuration and fix New-MemoryMappedFile path handling in tests
1 parent 9e77eed commit 89898bf

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/PSModule.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# This file is used to configure the Process-PSModule workflow.
22
# Reference:
33
# - https://github.com/PSModule/Process-PSModule?tab=readme-ov-file#configuration
4-
54
Test:
5+
SourceCode:
6+
Skip: true
7+
PSModule:
8+
Skip: true
9+
Module:
10+
MacOS:
11+
Skip: true
12+
Windows:
13+
Skip: true
14+
TestResults:
15+
Skip: true
616
CodeCoverage:
17+
Skip: true
718
PercentTarget: 0
19+
Build:
20+
Docs:
21+
Skip: true

src/functions/public/New-MemoryMappedFile.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@
5353
if (Test-Path $Path) {
5454
$file = Get-Item -Path $Path
5555
$Size = $file.Length
56-
}
57-
if (-not (Test-Path $Path)) {
58-
$null = New-Item -ItemType Directory -Path $directory -Force
56+
} else {
57+
$null = New-Item -Path $Path -ItemType File -Force
5958
}
6059
return [System.IO.MemoryMappedFiles.MemoryMappedFile]::CreateFromFile(
6160
$Path,

tests/MemoryMappedFile.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param()
1212
Describe 'Module' {
1313
Context 'MemoryMappedFile' {
1414
It 'New-MemoryMappedFile' {
15-
$fileName = '$HOME\test.json'
15+
$fileName = "$HOME\test.json"
1616
$size = 1024
1717
$mmf = New-MemoryMappedFile -Name 'shared' -Path $fileName -Size $size
1818
$mmf | Should -Not -BeNullOrEmpty

0 commit comments

Comments
 (0)