Add test for save script using Save-PSResource without -IncludeXml#1613
Add test for save script using Save-PSResource without -IncludeXml#1613o-l-a-v wants to merge 3 commits intoPowerShell:masterfrom o-l-a-v:test-add-script-save-psresource-without-includexml
Save-PSResource without -IncludeXml#1613Conversation
|
@microsoft-github-policy-service agree |
anamnavi
left a comment
There was a problem hiding this comment.
This looks great, thanks for adding this test and correcting the regression of our older test. I've added a few suggestions, mostly nitpicks to use PowerShell commands as we do throughout our other tests, but once that's in I'll approve, thanks @o-l-a-v !
| It "Save script without using -IncludeXML" { | ||
| Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw | ||
|
|
||
| $SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) |
There was a problem hiding this comment.
Just a nitpick to use Join-Path to be consistent with the rest of our tests
| $SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) | |
| $SavedScriptFile = Join-Path -Path $SaveDir -ChildPath "$testScriptName.ps1" |
| Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw | ||
|
|
||
| $SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) | ||
| [System.IO.File]::Exists($SavedScriptFile) | Should -BeTrue |
There was a problem hiding this comment.
Just a nitpick to use powershell command Test-Path to be consistent with the rest of our tests
| [System.IO.File]::Exists($SavedScriptFile) | Should -BeTrue | |
| Test-Path -Path $SavedScriptFile | Should -BeTrue |
|
@anamnavi : @SydneyhSmith told me to put tests into #1614 in #1614 (comment). So close this PR and continue in mentioned PR? |
|
@o-l-a-v ah yes, I missed that earlier. I'll close this PR. And add the comments from this to that PR. |
PR Summary
Add test for #1609
Which probably broke when fixing #1335
PR Context
Add test "Save script without using -IncludeXML" for saving script using
Save-PSResourcewithout-IncludeXml.Also fix typo and missing
-IncludeXmlin existing test "Save script using -IncludeXML".PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.