Skip to content

Instantly share code, notes, and snippets.

View danielniccoli's full-sized avatar
🐢
is how I roll.

Daniel Niccoli danielniccoli

🐢
is how I roll.
View GitHub Profile
@danielniccoli
danielniccoli / gist:f221abdd7567b7cc01cc91e9ff926270
Created October 12, 2023 15:50
Remove File Attributes that are not supported in PowerShell
Get-Item * | % {
$flagsToRemove = 0x00040000 -bor 0x00080000 -bor 0x00100000 -bor 0x00040000 -bor 0x00400000
$flags = ($_ | Get-ItemProperty).Attributes
$fixedFlags = $flags -band (-bnot $flagsToRemove)
$_ | Set-ItemProperty -Name attributes -Value $fixedFlags
}
function Test-Function {
[CmdletBinding()]
param(
[parameter(Mandatory, Position = 0, ValueFromPipeline)]
[string[]]
$Values
)
process {
$Values.ForEach({