@@ -21,10 +21,26 @@ function Assert-AddDevContainerJson{
2121 [string ] $Path
2222 )
2323 process {
24+ $Path = $Path | Convert-Path
25+
2426 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " .devcontainer" | Join-Path - ChildPath " devcontainer.json" ) - Comment " devcontainer.json"
2527 }
2628}
2729
30+ # Git Repository
31+ function Assert-AddGitRepository {
32+ param (
33+ [Parameter (Mandatory , Position = 0 , ValueFromPipeline , ValueFromPipelineByPropertyName )]
34+ [Alias (" PSPath" )][ValidateNotNullOrEmpty ()]
35+ [string ] $Path
36+ )
37+ process {
38+ $Path = $Path | Convert-Path
39+
40+ Assert-ItemExist - Path ($Path | Join-Path - ChildPath " .git" ) - Comment " .git"
41+ }
42+ }
43+
2844
2945# License
3046function Assert-AddLicense {
@@ -34,6 +50,8 @@ function Assert-AddLicense{
3450 [string ] $Path
3551 )
3652 process {
53+ $Path = $Path | Convert-Path
54+
3755 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " LICENSE" ) - Comment " LICENSE"
3856 }
3957}
@@ -46,6 +64,8 @@ function Assert-AddReadMe{
4664 [string ] $Path
4765 )
4866 process {
67+ $Path = $Path | Convert-Path
68+
4969 $name = $Path | Split-Path - LeafBase
5070 $readMePath = $Path | Join-Path - ChildPath " README.md"
5171 Assert-ItemExist - Path $readMePath - Comment " README.md"
@@ -69,6 +89,7 @@ function Assert-AddToModuleAbout{
6989 [string ] $Path
7090 )
7191 process {
92+ $Path = $Path | Convert-Path
7293
7394 $name = $Path | Split-Path - LeafBase
7495 $aboutFilePath = $Path | Join-Path - ChildPath " en-US" - AdditionalChildPath " about_$name .help.txt"
@@ -96,6 +117,8 @@ function Assert-AddDeployScript{
96117 [string ] $Path
97118 )
98119 process {
120+ $Path = $Path | Convert-Path
121+
99122 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " deploy.ps1" ) - Comment " deploy.ps1"
100123 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " deploy-helper.ps1" ) - Comment " deploy-helper.ps1"
101124 }
@@ -109,6 +132,8 @@ function Assert-AddReleaseScript{
109132 [string ] $Path
110133 )
111134 process {
135+ $Path = $Path | Convert-Path
136+
112137 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " release.ps1" ) - Comment " release.ps1"
113138 }
114139}
@@ -121,6 +146,8 @@ function Assert-AddSyncScript{
121146 [string ] $Path
122147 )
123148 process {
149+ $Path = $Path | Convert-Path
150+
124151 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " sync.ps1" ) - Comment " sync.ps1"
125152 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " sync-helper.ps1" ) - Comment " sync-helper.ps1"
126153 }
@@ -135,6 +162,8 @@ function Assert-AddPSScriptAnalyzerWorkflow{
135162 [string ] $Path
136163 )
137164 process {
165+ $Path = $Path | Convert-Path
166+
138167 $destination = $Path | Join-Path - ChildPath " .github" - AdditionalChildPath " workflows"
139168 Assert-ItemExist - Path ($destination | Join-Path - ChildPath " powershell.yml" ) - Comment " powershell.yml"
140169 }
@@ -149,6 +178,8 @@ function Assert-AddTestWorkflow{
149178 [string ] $Path
150179 )
151180 process {
181+ $Path = $Path | Convert-Path
182+
152183 $destination = $Path | Join-Path - ChildPath " .github" - AdditionalChildPath " workflows"
153184 Assert-ItemExist - Path ($destination | Join-Path - ChildPath " test_with_TestingHelper.yml" ) - Comment " test_with_TestingHelper.yml"
154185 }
@@ -163,6 +194,8 @@ function Assert-AddDeployWorkflow{
163194 [string ] $Path
164195 )
165196 process {
197+ $Path = $Path | Convert-Path
198+
166199 $destination = $Path | Join-Path - ChildPath " .github" - AdditionalChildPath " workflows"
167200 Assert-ItemExist - Path ($destination | Join-Path - ChildPath " deploy_module_on_release.yml" ) - Comment " deploy_module_on_release.yml"
168201 }
@@ -176,6 +209,8 @@ function Assert-AddSampleCodes{
176209 [string ] $Path
177210 )
178211 process {
212+ $Path = $Path | Convert-Path
213+
179214 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " public" | Join-Path - ChildPath " samplePublicFunction.ps1" ) - Comment " public function"
180215 Assert-ItemExist - Path ($Path | Join-Path - ChildPath " private" | Join-Path - ChildPath " samplePrivateFunction.ps1" ) - Comment " private function"
181216 }
@@ -189,6 +224,8 @@ function Assert-AddTestSampleCodes{
189224 [string ] $Path
190225 )
191226 process {
227+ $Path = $Path | Convert-Path
228+
192229 $name = $Path | Split-Path - LeafBase
193230 $testingModuleName = $Name + " Test"
194231 $testingModulePath = $path | Join-Path - ChildPath $testingModuleName
@@ -206,6 +243,8 @@ function Assert-AddTestLaunchJson{
206243 [string ] $Path
207244 )
208245 process {
246+ $Path = $Path | Convert-Path
247+
209248 $launchFile = $Path | Join-Path - ChildPath " .vscode" - AdditionalChildPath " launch.json"
210249
211250 Assert-ItemExist - Path $launchFile - Comment " launch.json exists"
@@ -232,6 +271,8 @@ function Assert-AddTestTestScript{
232271 [string ] $Path
233272 )
234273 process {
274+ $Path = $Path | Convert-Path
275+
235276
236277 $testps1Path = $Path | Join-Path - ChildPath " test.ps1"
237278
@@ -249,6 +290,8 @@ function Assert-AddModuleV3{
249290 [Parameter ()][hashtable ]$Expected
250291 )
251292 process {
293+ $Path = $Path | Convert-Path
294+
252295 $name = $Path | Split-Path - LeafBase
253296
254297 $psdname = $name + " .psd1"
@@ -318,6 +361,8 @@ function Assert-AddTestModuleV3{
318361 )
319362
320363 process {
364+ $Path = $Path | Convert-Path
365+
321366 $name = $Path | Split-Path - LeafBase
322367
323368 # $modulePath = $Path | Join-Path -ChildPath $Name
@@ -336,6 +381,8 @@ function Assert-AddTestAll {
336381 )
337382
338383 process {
384+ $Path = $Path | Convert-Path
385+
339386 $name = $Path | Split-Path - LeafBase
340387
341388 # $modulePath = $Path | Join-Path -ChildPath $Name
@@ -358,8 +405,10 @@ function Assert-AddAll{
358405 [string ] $Path
359406 )
360407 process {
408+ $Path = $Path | Convert-Path
361409
362410 $Path | Assert-AddDevContainerJson
411+ $Path | Assert-AddGitRepository
363412 $Path | Assert-AddLicense
364413 $Path | Assert-AddReadMe
365414 $Path | Assert-AddToModuleAbout
0 commit comments