Check for file exists and not zero byte otherwise bypass step execution and log messages Check for files older than 2 minutes and sends out notification if the file still exists check for files that have offline attribute and set it them to archive Check if .txt file is empty Check if...
#First we open the registry on the remote computer - note the ".NET" notation [Object.Properties]::Function([parameters]) ... $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer) #Second we open or navigate to ...
CreateSubKey(String, RegistryKeyPermissionCheck) Creates a new subkey, or opens an existing one. Utilizes Transaction.Current for its transaction. CreateSubKey(String) Creates a new subkey, or opens an existing one. Utilizes Transaction.Current for its transaction. DeleteSubKey(String, Boolean) ...
You need to test for the existence of the registry key. If the registry key does not exist, then you need to create the registry key, and then create the registry key property value. The first thing I like to do is to create the path to the registry key, then specify the property n...
Second, it provides information for properly installing the snap-in and for creating the appropriate registry entries to allow Windows PowerShell to find the assembly.There are two types of Windows PowerShell snap-ins in the System.Management.Automation namespace: PSSnapIn and CustomPSSnapIn. You ...
The previous examples do not set the default value for the newly created registry key. If the registry key already exists (as it does in this specific case), use theSet-Itemcmdlet to assign a default value to the registry key as follows. ...
For example, the following Windows PowerShell command gets the current “% Processor Time” combined values for all processors on the local computer every 2 seconds until it has 100 values and displays the captured data: PS C:\Users\mallen>Get-counter -Counter "\Processor(_Total)\% Processor...
I try to create a test key in the shell's HKLM: drive, which represents the HKEY_LOCAL_MACHINE portion of the registry. If an error occurs, then I know the shell was launched without elevated privileges. I usually require elevated privileges for the work I do, and this is just a quick...
xComputer DomainJoin { Name = $Node.ServerName DomainName = $Node.DomainName Credential = $Node.Credential } # The next series of settings disable SSL and enable TLS, for environments where that is required by policy. Registry TLS1_2ServerEnabled { Ensure = 'Present' Key = 'HKLM:\SYSTEM...
For servers running Exchange Server 2013 If you have servers that are running Microsoft Exchange Server 2013 in your environment, you must configure a registry key on each server. Specify the following settings. Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\...