'requested file operation failed in PowerShell
I'm trying to read a txt file from my directory and getting the following error. This is the first time seeing it and I don't think it happened to me before. So, just wondering what's going on and how to fix this.
$FilePath = 'C:\Users\yzqpsn\Desktop\Audit-Log-Script\teams.txt'
$Data = Get-Content -Path $FilePath
Get-Content : The requested file operation failed because the storage policy blocks that type of file. For more information, contact your system
administrator.
At line:1 char:9
+ $Data = Get-Content -Path $FilePath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ReadError: (C:\Users\yzqpsn...cript\teams.txt:String) [Get-Content], IOException
+ FullyQualifiedErrorId : GetContentReaderIOError,Microsoft.PowerShell.Commands.GetContentCommand
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
