Created
January 31, 2020 21:20
-
-
Save MateuszNad/e176a1f620ff2cf6f3a87fa66f605236 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Join-PathElement { | |
| param( | |
| [string[]]$Element | |
| ) | |
| [array]$FullPath = $Element[0] | |
| for ($i = 1; $i -lt $Element.Count; $i++) { | |
| $FullPath += Join-Path -Path $FullPath -ChildPath $Element[$i] | |
| } | |
| $Id = $FullPath.Count - 1 | |
| Write-Output ($FullPath[$Id]) | |
| } | |
| Describe 'Przyklad testu' { | |
| It 'Sprawdzanie wyniku' { | |
| Join-PathElement -Element 'C:\Users', 'Temp', 'file.txt' | Should -Be 'C:\Users\Temp\file.txt' | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment