Skip to content

Access Denied error on Temp Dir? #51

Description

@sparkle263

Hello, I found your repo after not being able to get dfinkle's one to work - though the idea is super promising!

And I can get your module installed with no problem, everything looks good.
But when I go to use it as intended, I keep getting an Accessed Denied error on the temp dir it is trying to use...?
PS is running as Admin, I am a Local admin of the machine, and even if I specify a destination path, it never gets that far...
Am I missing something simple here?

.Net FrameWork Full Version : 4.8.04084
PowerShell Version          : 5.1.19041.2673
OS Version                  : Microsoft Windows 10 Enterprise  v. 22H2 Build. 19045.2728
--- [WITHOUT DESTINATION PATH] -----------------------------------------------------------------------------------

Remove-Item : Cannot remove item C:\Users\USERNAME\AppData\Local\Temp\01aefda8-69bf-48ec-82ea-9ca9b8193d59.tmp: 
The process cannot access the file 'C:\Users\USERNAME\AppData\Local\Temp\01aefda8-69bf-48ec-82ea-9ca9b8193d59.tmp' 
because it is being used by another process.

At C:\Program Files\WindowsPowerShell\Modules\InstallModuleFromGit\1.2.0\Public\Get-GitModule.ps1:53 char:17
+                 Remove-Item (Join-Path $tempDir '*') -Recurse -Force
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\USERNAME...ca9b8193d59.tmp:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

--- [WITH DESTINATION PATH] ---------------------------------------------------------------------------------------
WARNING: Install-GitModule using path which is not in $Env:PSModulePath (O:\Temp\TestModules)

Remove-Item : Cannot remove item C:\Users\USERNAME\AppData\Local\Temp\f86a921e-06e3-4c96-b089-54ac0ef8fa52.tmp: 
The process cannot access the file 'C:\Users\USERNAME\AppData\Local\Temp\f86a921e-06e3-4c96-b089-54ac0ef8fa52.tmp' 
because it is being used by another process.

At C:\Program Files\WindowsPowerShell\Modules\InstallModuleFromGit\1.2.0\Public\Get-GitModule.ps1:53 char:17
+                 Remove-Item (Join-Path $tempDir '*') -Recurse -Force
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\USERNAME...4ac0ef8fa52.tmp:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
--------------------------------------------------------------------------------------------------------------------

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions