Set Permissions on a File or Directory using PowerShell

There are basically two commands which are used to play around with permissions on a fileGet-Acl – The Get-Acl cmdlet gets objects that represent the security descriptor of a file or resource. The security descriptor contains the access control lists (ACLs) of…
Using Performance Counter with PowerShell to Extract Server Uptime

To retrieve information about a Performance Counter, we can use the Get-Counter cmdlet.Here’s an example of extracting the up time for a server using powershell. $uptimecounter = Get-Counter "SystemSystem Up Time" $pcuptime = $uptimecounter.CounterSamples[0].CookedValue New-TimeSpan -Seconds $pcuptime Here’s i can see my Server Up Time Information in a very…
Customizing PowerShell Prompt via $Profile

If you want to customize PowerShell’s interactive experience with a personalized prompt, you need to modify the $profile variable.   <#Create a new profile (and overwrite one if it already exists):#>  New-Item -type file -force $profile <#To edit your profile:#> notepad $profile   <#To see…