SEP 11 definitions:
1 |
FOR /F "tokens=6 delims=\" %i IN ('reg query HKLM\SOFTWARE\Symantec\SharedDefs /f DEFWATCH_10') DO @echo %i |
Informations provided by Security Center:
1 |
Get-WmiObject -Class AntivirusProduct -Namespace root\SecurityCenter2 |
How to read productState: http://neophob.com/2010/03/wmi-query-windows-securitycenter2/
The default Linux prompt gives you additional helpful information while working through a session instead of Windows.
The example below displays a user who is logged in along with the hostname in a windows command line.
1 2 3 |
C:\Windows\system32>set prompt=[%username%@%computername% $P]# [strachotao@PC101 C:\Windows\system32]# |
It will change creation time of fileName.txt
1 |
Get-ChildItem "fileName.txt" | Foreach-Object { $_.CreationTime = '1/1/2020 12:34'} |
It will change values $TimeType of all files in $Folder
1 2 3 4 5 6 7 8 9 |
$Folder = Get-ChildItem "C:\temp\test\*" $FileTime = "3/10/1982 06:30" $TimeType = ("CreationTime", "LastWriteTime", "LastAccessTime") foreach ($File in $Folder) { foreach ($Time in $TimeType) { Get-ChildItem "$File" | Foreach-Object {$_."$Time" = "$FileTime"} } } |
It will change values $TimeSettings of all files in $Folder using Hash Table
1 2 3 4 5 6 7 8 9 10 |
$Folder = Get-ChildItem "C:\temp\test\*" $TimeSettings = @{'CreationTime' = '3/10/1975 06:30'; 'LastWriteTime' = '3/10/1982 06:30'; 'LastAccessTime' = '5/21/2012 13:30'} foreach ($File in $Folder) { $TimeSettings.GetEnumerator() | Foreach-Object { $FileProperty = $_.Key $DateValue = $_.Value Get-ChildItem "$File" | Foreach-Object {$_."$FileProperty" = "$DateValue"} } } |