external help file | Module Name | online version | schema |
---|---|---|---|
ResourceLocker-help.xml |
ResourceLocker |
2.0.0 |
Locks a host with some type of a lock plus it allows you to set some advanced options which the other two functions don't.
Lock-Resource [-ComputerName] <String> [[-CallerName] <String>] [[-Type] <String>] [[-Description] <String>]
[[-Timeout] <Int32>] [[-Retry] <Int32>] [-NoDependencies] [[-SessionID] <String>] [<CommonParameters>]
This function allows you more flexibility than Lock-FileResource
and Lock-HostResource
, but should not really be used except for testing and edge cases.
PS C:\> $Lock = Lock-Resource -ComputerName SRV01 -NoDependencies
Locks SRV01 host w/o resolving its dependencies - the lock will be set on that host only.
Specifies the name of a computer to lock.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies which type of lock to use.
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Host, Generic, File
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies an arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies an arbitrary description of a lock. Currently is used by the Lock-FileResource function to store filename's here.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prevents the function from resolving dependencies - it will lock only the host against which it was called.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the number of retries to set a lock, before raising an exception.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: $ModuleWideLockRetries
Accept pipeline input: False
Accept wildcard characters: False
Specifies the timeout for each retry to set a lock.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: $ModuleWideLockTimeout
Accept pipeline input: False
Accept wildcard characters: False
Specifies session ID which is used to identify all locks in this invocation. Use this parameter if you don't want to use auto-generated GUIDs as session IDs.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).