Showing posts with label new-itemproperty. Show all posts
Showing posts with label new-itemproperty. Show all posts

Monday, January 19, 2009

change MaxSize of EventLog via registry

to overwrite a pre-existing registry entry value

PS> New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Eventlog\Application -Name MaxSize -PropertyType DWord -Value 512 -force

'512' is in decimal format; it means 512KB

add new registry key

to add a new entry named 'PowerShellPath' to the CurrentVersion key, and return information about the new entry

PS> New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion -Name PowerShellPath -PropertyType String -Value $PSHome

PowerShellPath
--------------
C:\LINDOWS\system32\WindowsPowerShell\v1.0\