aaronparker / fslogix

Scripts for use with FSLogix Apps, Containers etc.
https://stealthpuppy.com/fslogix
MIT License
92 stars 54 forks source link

Very problematic when you continue this function. #19

Open ajdinaliu opened 3 years ago

ajdinaliu commented 3 years ago

https://github.com/aaronparker/FSLogix/blob/033e83561769593e77fd08aba027fa81853ef422/Modules/Fslogix.Powershell.Disk/Private/Get-DiskInformation.ps1#L16

Get-DiskImage returns an error "The process cannot access the file because it is being used by another process.", if a user is logged on with the container in $Path.

You should change this to: Write-Error $Error[0] -ErrorAction Stop

Otherwise, functions like Get-FslDisk will fail, if a container is "in use"!