Skip to content

Commit 86e72a9

Browse files
committed
Update references to New and Test PSScriptFile
1 parent a32af99 commit 86e72a9

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

Test/NewPSScriptFile.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $modPath = "$psscriptroot/../PSGetTestUtils.psm1"
55
Import-Module $modPath -Force -Verbose
66
Write-Verbose -Verbose -Message "PowerShellGet version currently loaded: $($(Get-Module powershellget).Version)"
77

8-
Describe "Test CompatPowerShellGet: New-PSScriptFile" -tags 'CI' {
8+
Describe "Test CompatPowerShellGet: New-PSScriptFileInfo" -tags 'CI' {
99
BeforeAll {
1010
$tmpDir1Path = Join-Path -Path $TestDrive -ChildPath "tmpDir1"
1111
$tmpDirPaths = @($tmpDir1Path)
@@ -25,7 +25,7 @@ Describe "Test CompatPowerShellGet: New-PSScriptFile" -tags 'CI' {
2525
It "Create .ps1 file with minimal required fields" {
2626
$description = "Test description"
2727
New-ScriptFileInfo -Path $script:testScriptFilePath -Description $description
28-
Test-PSScriptFile -Path $script:testScriptFilePath | Should -BeTrue
28+
Test-PSScriptFileInfo -Path $script:testScriptFilePath | Should -BeTrue
2929
}
3030

3131
It "Create .ps1 file with relative path" {
@@ -35,7 +35,7 @@ Describe "Test CompatPowerShellGet: New-PSScriptFile" -tags 'CI' {
3535
$description = "Test description"
3636
New-ScriptFileInfo -Path $scriptFilePath -Description $description
3737

38-
Test-PSScriptFile -Path $scriptFilePath | Should -BeTrue
38+
Test-PSScriptFileInfo -Path $scriptFilePath | Should -BeTrue
3939
Remove-Item -Path $scriptFilePath
4040
}
4141

Test/PublishPSResource.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Describe "Test CompatPowerShellGet: Publish-PSResource" -tags 'CI' {
251251
}
252252

253253
$scriptPath = (Join-Path -Path $script:tmpScriptsFolderPath -ChildPath "$scriptName.ps1")
254-
New-PSScriptFile @params -Path $scriptPath
254+
New-PSScriptFileInfo @params -Path $scriptPath
255255

256256
Publish-Script -Path $scriptPath
257257

Test/TestPSScriptFile.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Import-Module $modPath -Force -Verbose
66
Write-Verbose -Verbose -Message "PowerShellGet version currently loaded: $($(Get-Module powershellget).Version)"
77
$testDir = (get-item $psscriptroot).parent.FullName
88

9-
Describe "Test CompatPowerShellGet: Test-PSScriptFile" -tags 'CI' {
9+
Describe "Test CompatPowerShellGet: Test-PSScriptFileInfo" -tags 'CI' {
1010
BeforeAll {
1111
$tmpDir1Path = Join-Path -Path $TestDrive -ChildPath "tmpDir1"
1212
$tmpDirPaths = @($tmpDir1Path)
@@ -25,7 +25,7 @@ Describe "Test CompatPowerShellGet: Test-PSScriptFile" -tags 'CI' {
2525
$guid = [guid]::NewGuid()
2626
$author = "Script Author"
2727
$version = "1.0.0"
28-
New-PSScriptFile -Path $scriptFilePath -Description $scriptDescription -Guid $guid -Author $author -Version $version
28+
New-PSScriptFileInfo -Path $scriptFilePath -Description $scriptDescription -Guid $guid -Author $author -Version $version
2929
Test-ScriptFileInfo $scriptFilePath | Should -Be $true
3030
}
3131

Test/UpdatePSScriptFileInfo.Tests.ps1

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
2525
$script:psScriptInfoName = "test_script"
2626
$scriptDescription = "this is a test script"
2727
$script:testScriptFilePath = Join-Path -Path $tmpDir1Path -ChildPath "$script:psScriptInfoName.ps1"
28-
New-PSScriptFile -Path $script:testScriptFilePath -Description $scriptDescription
28+
New-PSScriptFileInfo -Path $script:testScriptFilePath -Description $scriptDescription
2929
}
3030

3131
AfterEach {
@@ -40,10 +40,10 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
4040
$scriptFilePath = Join-Path -Path $relativeCurrentPath -ChildPath "$script:psScriptInfoName.ps1"
4141
$oldDescription = "Old description for test script"
4242
$newDescription = "New description for test script"
43-
New-PSScriptFile -Path $scriptFilePath -Description $oldDescription
43+
New-PSScriptFileInfo -Path $scriptFilePath -Description $oldDescription
4444

4545
Update-ScriptFileInfo -Path $scriptFilePath -Description $newDescription
46-
Test-PSScriptFile -Path $scriptFilePath | Should -BeTrue
46+
Test-PSScriptFileInfo -Path $scriptFilePath | Should -BeTrue
4747

4848
Test-Path -Path $scriptFilePath | Should -BeTrue
4949
$results = Get-Content -Path $scriptFilePath -Raw
@@ -63,10 +63,10 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
6363
$relativeCurrentPath = Get-Location
6464
$scriptFilePath = Join-Path -Path $relativeCurrentPath -ChildPath "$script:psScriptInfoName.ps1"
6565

66-
New-PSScriptFile -Path $scriptFilePath -Description $description -Version $version -Author $author -ProjectUri $projectUri
66+
New-PSScriptFileInfo -Path $scriptFilePath -Description $description -Version $version -Author $author -ProjectUri $projectUri
6767
Update-ScriptFileInfo -Path $scriptFilePath -Author $newAuthor
6868

69-
Test-PSScriptFile -Path $scriptFilePath | Should -BeTrue
69+
Test-PSScriptFileInfo -Path $scriptFilePath | Should -BeTrue
7070
$results = Get-Content -Path $scriptFilePath -Raw
7171
$results.Contains($newAuthor) | Should -BeTrue
7272
$results.Contains(".AUTHOR $newAuthor") | Should -BeTrue
@@ -87,7 +87,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
8787
It "update script file Author property" {
8888
$author = "New Author"
8989
Update-ScriptFileInfo -Path $script:testScriptFilePath -Author $author
90-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
90+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
9191

9292
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
9393
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -98,7 +98,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
9898
It "update script file Version property" {
9999
$version = "2.0.0.0"
100100
Update-ScriptFileInfo -Path $script:testScriptFilePath -Version $version
101-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
101+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
102102

103103
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
104104
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -109,7 +109,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
109109
It "update script file Version property with prerelease version" {
110110
$version = "3.0.0-alpha"
111111
Update-ScriptFileInfo -Path $script:testScriptFilePath -Version $version
112-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
112+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
113113

114114
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
115115
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -126,7 +126,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
126126
It "update script file Description property" {
127127
$description = "this is an updated test script"
128128
Update-ScriptFileInfo -Path $script:testScriptFilePath -Description $description
129-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
129+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
130130

131131
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
132132
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -137,7 +137,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
137137
It "update script file Guid property" {
138138
$guid = [Guid]::NewGuid();
139139
Update-ScriptFileInfo -Path $script:testScriptFilePath -Guid $guid
140-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
140+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
141141

142142
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
143143
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -148,7 +148,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
148148
It "update script file CompanyName property" {
149149
$companyName = "New Corporation"
150150
Update-ScriptFileInfo -Path $script:testScriptFilePath -CompanyName $companyName
151-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
151+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
152152

153153
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
154154
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -159,7 +159,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
159159
It "update script file Copyright property" {
160160
$copyright = "(c) 2022 New Corporation. All rights reserved"
161161
Update-ScriptFileInfo -Path $script:testScriptFilePath -Copyright $copyright
162-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
162+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
163163

164164
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
165165
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -171,7 +171,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
171171
$externalModuleDep1 = "ExternalModuleDep1"
172172
$externalModuleDep2 = "ExternalModuleDep2"
173173
Update-ScriptFileInfo -Path $script:testScriptFilePath -ExternalModuleDependencies $externalModuleDep1,$externalModuleDep2
174-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
174+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
175175

176176
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
177177
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -184,7 +184,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
184184
$externalScriptDep1 = "ExternalScriptDep1"
185185
$externalScriptDep2 = "ExternalScriptDep2"
186186
Update-ScriptFileInfo -Path $script:testScriptFilePath -ExternalScriptDependencies $externalScriptDep1,$externalScriptDep2
187-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
187+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
188188

189189
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
190190
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -196,7 +196,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
196196
It "update script file IconUri property" {
197197
$iconUri = "https://testscript.com/icon"
198198
Update-ScriptFileInfo -Path $script:testScriptFilePath -IconUri $iconUri
199-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
199+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
200200

201201
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
202202
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -207,7 +207,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
207207
It "update script file LicenseUri property" {
208208
$licenseUri = "https://testscript.com/license"
209209
Update-ScriptFileInfo -Path $script:testScriptFilePath -LicenseUri $licenseUri
210-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
210+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
211211

212212
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
213213
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -218,7 +218,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
218218
It "update script file ProjectUri property" {
219219
$projectUri = "https://testscript.com/"
220220
Update-ScriptFileInfo -Path $script:testScriptFilePath -ProjectUri $projectUri
221-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
221+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
222222

223223
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
224224
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -229,7 +229,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
229229
It "update script file PrivateData property" {
230230
$privateData = "this is some private data"
231231
Update-ScriptFileInfo -Path $script:testScriptFilePath -PrivateData $privateData
232-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
232+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
233233

234234
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
235235
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -240,7 +240,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
240240
It "update script file ReleaseNotes property" {
241241
$releaseNotes = "Release notes for script."
242242
Update-ScriptFileInfo -Path $script:testScriptFilePath -ReleaseNotes $releaseNotes
243-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
243+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
244244

245245
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
246246
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -256,7 +256,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
256256
$requiredModules = @($hashtable1, $hashtable2, $hashtable3, $hashtable4)
257257

258258
Update-ScriptFileInfo -Path $script:testScriptFilePath -RequiredModules $requiredModules
259-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
259+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
260260

261261
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
262262
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -269,7 +269,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
269269
$requiredScript1 = "RequiredScript1"
270270
$requiredScript2 = "RequiredScript2"
271271
Update-ScriptFileInfo -Path $script:testScriptFilePath -RequiredScripts $requiredScript1, $requiredScript2
272-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
272+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
273273

274274
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
275275
$results = Get-Content -Path $script:testScriptFilePath -Raw
@@ -282,7 +282,7 @@ Describe "Test CompatPowerShellGet: Update-PSScriptFileInfo" -tags 'CI' {
282282
$tag1 = "tag1"
283283
$tag2 = "tag2"
284284
Update-ScriptFileInfo -Path $script:testScriptFilePath -Tags $tag1, $tag2
285-
Test-PSScriptFile $script:testScriptFilePath | Should -Be $true
285+
Test-PSScriptFileInfo $script:testScriptFilePath | Should -Be $true
286286

287287
Test-Path -Path $script:testScriptFilePath | Should -BeTrue
288288
$results = Get-Content -Path $script:testScriptFilePath -Raw

src/CompatPowerShellGet.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ param(
12901290
if ( $PSBoundParameters['PassThru'] ) { $null = $PSBoundParameters.Remove('PassThru') }
12911291
# END PARAMETER MAP
12921292

1293-
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('New-PSScriptFile', [System.Management.Automation.CommandTypes]::Cmdlet)
1293+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('New-PSScriptFileInfo', [System.Management.Automation.CommandTypes]::Cmdlet)
12941294
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
12951295

12961296
$steppablePipeline = $scriptCmd.GetSteppablePipeline()
@@ -2062,7 +2062,7 @@ param(
20622062
if ( $PSBoundParameters['LiteralPath'] ) { $null = $PSBoundParameters.Remove('LiteralPath'); $PSBoundParameters['Path'] = $LiteralPath }
20632063
# END PARAMETER MAP
20642064

2065-
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Test-PSScriptFile', [System.Management.Automation.CommandTypes]::Cmdlet)
2065+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Test-PSScriptFileInfo', [System.Management.Automation.CommandTypes]::Cmdlet)
20662066
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
20672067

20682068
$steppablePipeline = $scriptCmd.GetSteppablePipeline()

0 commit comments

Comments
 (0)