Skip to content

Commit

Permalink
added random number between 0 and 100000 to filename to prevent cachi…
Browse files Browse the repository at this point in the history
…ng collision.
  • Loading branch information
KelvinTegelaar authored and Windos committed Aug 3, 2020
1 parent 70a7666 commit fdf5d87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BurntToast/Private/Optimize-BTImageSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Optimize-BTImageSource {
)

if ([bool]([System.Uri]$Source).IsUnc -or $Source -like 'http?://*') {
$RemoteFileName = $Source.Split('/\')[-1] -replace '[\[\]*?]',''
$RemoteFileName = "$(get-random -min 0 -max 100000)" +$Source.Split('/\')[-1] -replace '[\[\]*?]',''

$NewFilePath = '{0}\{1}' -f $Env:TEMP, $RemoteFileName

Expand Down

0 comments on commit fdf5d87

Please sign in to comment.