File tree Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ $BuildOutputDir = Join-Path $root "\src\bin\Release"
12
12
$ManifestPath = " ${BuildOutputDir} \${Name} .psd1"
13
13
$ManifestData = Import-PowerShellDataFile - Path $ManifestPath
14
14
$Version = $ManifestData.ModuleVersion
15
- $Prerelease = $ManifestPath.PrivateData.PSData.Prerelease
15
+ # $Prerelease = $ManifestPath.PrivateData.PSData.Prerelease
16
16
17
17
# this takes the files for the module and publishes them to a created, local repository
18
18
# so the nupkg can be used to publish to the PSGallery
@@ -32,7 +32,7 @@ function Export-Module
32
32
Publish-Module - Path $packageRoot - Repository $repoName
33
33
Unregister-PSRepository - Name $repoName
34
34
Get-ChildItem - Recurse - Name $packageRoot | Write-Verbose
35
- $nupkgName = " {0}.{1}-{2} .nupkg" -f ${Name} , ${Version} , ${Prerelease }
35
+ $nupkgName = " {0}.{1}-preview2 .nupkg" -f ${Name} , ${Version}
36
36
37
37
38
38
$nupkgPath = Join-Path $packageRoot $nupkgName
Original file line number Diff line number Diff line change @@ -785,4 +785,54 @@ BeforeDiscovery {
785
785
$archiveInUseStream.Dispose ()
786
786
}
787
787
}
788
+
789
+ Context " Long path tests" {
790
+ BeforeAll {
791
+ if ($IsWindows ) {
792
+ $maxPathLength = 260
793
+ }
794
+ if ($IsLinux ) {
795
+ $maxPathLength = 255
796
+ }
797
+ if ($IsMacOS ) {
798
+ $maxPathLength = 1024
799
+ }
800
+
801
+ function Get-MaxLengthPath {
802
+ param (
803
+ [string ] $character
804
+ )
805
+
806
+ $path = " ${TestDrive} /"
807
+ while ($path.Length -le $maxPathLength + 2 ) {
808
+ $path += $character
809
+ }
810
+ return $path
811
+ }
812
+
813
+ New-Item - Path " TestDrive:/file.txt" - ItemType File
814
+ " Hello, World!" | Out-File - FilePath " TestDrive:/file.txt"
815
+ }
816
+
817
+
818
+ It " Throws an error when -Path is too long" {
819
+
820
+ }
821
+
822
+ It " Throws an error when -LiteralPath is too long" {
823
+
824
+ }
825
+
826
+ It " Throws an error when -DestinationPath is too long" {
827
+ $path = " TestDrive:/file.txt"
828
+ # This will generate a path like TestDrive:/aaaaaa...aaaaaa
829
+ $destinationPath = Get-MaxLengthPath - character a
830
+ Write-Warning $destinationPath.Length
831
+ try {
832
+ Compress-Archive - Path $path - DestinationPath $destinationPath
833
+ } catch {
834
+ throw " ${$_.Exception} "
835
+ }
836
+ }
837
+ }
788
838
}
You can’t perform that action at this time.
0 commit comments