diff --git a/PeterDocs/PeterDocs.psd1 b/PeterDocs/PeterDocs.psd1 index 8ad8704..fa879c0 100644 Binary files a/PeterDocs/PeterDocs.psd1 and b/PeterDocs/PeterDocs.psd1 differ diff --git a/PeterDocs/PeterDocs.psm1 b/PeterDocs/PeterDocs.psm1 index f086cfe..e3b8455 100644 --- a/PeterDocs/PeterDocs.psm1 +++ b/PeterDocs/PeterDocs.psm1 @@ -33,7 +33,7 @@ $global:default_metaFile = "##peter##.json" $global:default_errorListFile = Join-Path -Path ".\" -ChildPath "##peter_error_list##.txt" $global:LogPathName = "" $global:MetadataPathName = Join-Path -Path ".\" -ChildPath ".peter-metadata" -$global:Version = "0.31" +$global:Version = "0.32" function Open-Log { @@ -775,13 +775,13 @@ Param( { $SecretFile = $ArchiveFile + ".key" } + $secret = New-RandomPassword -Length 80 + Protect-CmsMessage -To $recipientKey -OutFile $SecretFile -Content $secret if (!(Test-Path -Path $SecretFile)) { Write-Log "Secret file '$SecretFile' not found" Close-Log Throw "Secret file '$SecretFile' not found" } - $secret = New-RandomPassword -Length 80 - Protect-CmsMessage -To $recipientKey -OutFile $SecretFile -Content $secret } else { if (!(Test-PasswordQuality -TestPassword $SecretKey)) { Write-Log "Secret Key does not meet complexity rules" diff --git a/README.md b/README.md index 80ffbe0..56f1940 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,26 @@ via local file NuGet package file if Internet access is limited. See the [Advanced Usage](Docs/Advanced.md) for more advanced options. +## Limitations + +### Secure string + +The current version does not use secure strings for password protection +within the code. You data is stil protected with encryption. + +## Path length + +There is a limitation with the PowerShell functions used within PeterDocs +of file paths having to be 260 characters in length or less. + +If you have long file paths, the processing will fail. A possible +work around is to use mapped net work drive even on your local sourced +file. The command in PowerShell would be something like: + +```powershell +New-PSDrive "X" -PSProvider FileSysytem -Root "$Source" +``` + ## Further Reading [Design](Docs/Design.md) diff --git a/samples/Robocopy_sample.ps1 b/samples/Robocopy_sample.ps1 index 961d685..d64877d 100644 --- a/samples/Robocopy_sample.ps1 +++ b/samples/Robocopy_sample.ps1 @@ -5,6 +5,10 @@ param ( [String] $Destination ) +# Note that there is a path limitation for files of 260 characters +# beyond which PeterDocs will fail +# You could also use drive mapping to overcome this +# New-PSDrive "X" -PSProvider FileSysytem -Root "$Source" $step ="Starting" Try { @@ -13,7 +17,7 @@ Try { $step ="Running robocopy" Write-Host "Running robocopy for source '$Source' and destination '$Destination'" # Change the command line switches to suit - robocopy `"C:\Users\tom\Small Share\misc_05`" `"$Destination`" /e /copy:DAT /dcopy:DAT /log+:./robocopy.log + robocopy `"$Source`" "$Destination" /e /copy:DAT /dcopy:DAT /log+:./robocopy.log /r:1000 /w:10 if ($LastExitCode -lt 8) { Write-Host "Robocopy succeeded" } else {