Day: 20 March 2017

  • Check for folders and files where access is denied with Powershell

    The following script is from another blog that was slightly adapted by someone who left a comment there: $errors=@() gci -recurse -Path “C:\test” -ea SilentlyContinue -ErrorVariable +errors | Out-Null $errors.Count $errors | select -expand categoryinfo | select reason,targetname | export-csv -NoTypeInformation -Delimiter “;” ErrorList.csv I created a folder on the root of my C: drive…

  • Check and amend the read only attribute with Powershell

    We can use the following to iterate through a series of folders and check the read only status of the files: $Directories = “C:\drop\Test Complete\Dev\Global\Master\SeleniumTests” gci -Recurse -Path ${Directories} | select fullname,isreadonly It is not necessary to specify the list of directories as a variable but for my use it makes sense. We use the…