en-US/ResourceLocker-help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-ResourceDependence</command:name> <command:verb>Get</command:verb> <command:noun>ResourceDependence</command:noun> <maml:description> <maml:para>Returns a dependency tree for a host.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Use this function to determine which hosts will be locked along with a network host.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-ResourceDependence</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceName</maml:name> <maml:Description> <maml:para>Specifies the name of a resource for which to build a dependency tree.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies the path to a file, containing host dependencies description.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideResourceDependenciesFilePath</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-ResourceDependence</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceName</maml:name> <maml:Description> <maml:para>Specifies the name of a resource for which to build a dependency tree.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceDependencies</maml:name> <maml:Description> <maml:para>Specifies a dependencies object instead of a file. This parameter is for internal purposes - you don't really need to use it.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceName</maml:name> <maml:Description> <maml:para>Specifies the name of a resource for which to build a dependency tree.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies the path to a file, containing host dependencies description.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideResourceDependenciesFilePath</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceDependencies</maml:name> <maml:Description> <maml:para>Specifies a dependencies object instead of a file. This parameter is for internal purposes - you don't really need to use it.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Get-ResourceDependence -ResourceName SRV01</dev:code> <dev:remarks> <maml:para>Retuns a dependency tree for SRV01.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Get-ResourceDependence.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-ResourceLockId</command:name> <command:verb>Get</command:verb> <command:noun>ResourceLockId</command:noun> <maml:description> <maml:para>Returns the lock ID from a lock object.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Extracts the lock ID from a lock object and returns it as a string. The function basically has a meaning for debugging purposes only.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-ResourceLockId</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>LockObject</maml:name> <maml:Description> <maml:para>Specifies the lock object to examine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">FileInfo[]</command:parameterValue> <dev:type> <maml:name>FileInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>LockObject</maml:name> <maml:Description> <maml:para>Specifies the lock object to examine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">FileInfo[]</command:parameterValue> <dev:type> <maml:name>FileInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.IO.FileInfo[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Get-ResourceLockId -LockObject $Lock</dev:code> <dev:remarks> <maml:para>Gets the ID from a lock object.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Get-ResourceLockId.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Lock-FileResource</command:name> <command:verb>Lock</command:verb> <command:noun>FileResource</command:noun> <maml:description> <maml:para>Locks a host on which a network file resides.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Use this function when you work with a network share and want to lock a host which hosts the share. The function puts the name of the file into lock's description. The function puts locks of the "File" type only.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Lock-FileResource</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path to the file with which you are about to work.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path to the file with which you are about to work.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $Lock = Lock-FileResource -Path \\fs01\share1\example.iso -CallerName $MyInvocation.MyCommand.Name</dev:code> <dev:remarks> <maml:para>Puts a file lock to FS01 host. The caller name in that lock will be the name of the function invoking the command. Usually you'd want to save a lock object into a variable so later you could pass it to the `Unlock-Resource` function.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Lock-FileResource.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Lock-HostResource</command:name> <command:verb>Lock</command:verb> <command:noun>HostResource</command:noun> <maml:description> <maml:para>Locks a host with a "Generic" or a "Host" lock.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Use this function to just lock a host. If you want to prevent sunsequent locks on the host, use the `-Hard` parameter.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Lock-HostResource</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Hard</maml:name> <maml:Description> <maml:para>Specifies that the host should be locked with a lock of the "Host" type.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Hard</maml:name> <maml:Description> <maml:para>Specifies that the host should be locked with a lock of the "Host" type.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $Lock = Lock-HostResource -ComputerName SRV01 -CallerName $MyInvocation.MyCommand.Name -Hard</dev:code> <dev:remarks> <maml:para>Locks a host called SRV01 with a lock of the "Host" type. The caller name in that lock will be the name of the function invoking the command. Usually you'd want to save a lock object into a variable so later you could pass it to the `Unlock-Resource` function.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Lock-HostResource -CallerName admin-joe</dev:code> <dev:remarks> <maml:para>Locks a local host with a lock of the "Generic" type. The caller name inside of that lock will be "admin-joe". Useful, when you work on a host and need to reboot it manually. In this example the user does not save the object into a variable, because it will be lost during the reboot anyway - they'll need to deal with that lock manually later.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Lock-HostResource.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Lock-Resource</command:name> <command:verb>Lock</command:verb> <command:noun>Resource</command:noun> <maml:description> <maml:para>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.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This function allows you more flexibility than `Lock-FileResource` and `Lock-HostResource`, but should not really be used except for testing and edge cases.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Lock-Resource</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Specifies an arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies which type of lock to use.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Generic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">File</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies an arbitrary description of a lock. Currently is used by the Lock-FileResource function to store filename's here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the timeout for each retry to set a lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockTimeout</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="5" aliases="none"> <maml:name>Retry</maml:name> <maml:Description> <maml:para>Specifies the number of retries to set a lock, before raising an exception.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockRetries</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="6" aliases="none"> <maml:name>SessionID</maml:name> <maml:Description> <maml:para>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.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoDependencies</maml:name> <maml:Description> <maml:para>Prevents the function from resolving dependencies - it will lock only the host against which it was called.</maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies which type of lock to use.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>CallerName</maml:name> <maml:Description> <maml:para>Specifies an arbitrary description of an entity which set the lock. We recommend to pass the name of a caller function here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies an arbitrary description of a lock. Currently is used by the Lock-FileResource function to store filename's here.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoDependencies</maml:name> <maml:Description> <maml:para>Prevents the function from resolving dependencies - it will lock only the host against which it was called.</maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="5" aliases="none"> <maml:name>Retry</maml:name> <maml:Description> <maml:para>Specifies the number of retries to set a lock, before raising an exception.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockRetries</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the timeout for each retry to set a lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockTimeout</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="6" aliases="none"> <maml:name>SessionID</maml:name> <maml:Description> <maml:para>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.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $Lock = Lock-Resource -ComputerName SRV01 -NoDependencies</dev:code> <dev:remarks> <maml:para>Locks SRV01 host w/o resolving its dependencies - the lock will be set on that host only.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Lock-Resource.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Test-HostResourceLock</command:name> <command:verb>Test</command:verb> <command:noun>HostResourceLock</command:noun> <maml:description> <maml:para>Tests if a computer has a lock of some kind in place.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The function tests if a computer has a lock of some type on it. You can use the `-Type` parameter to specify in which type exactly you are interested.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-HostResourceLock</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to test.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies for which types of locks to look.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Generic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">File</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Any</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FolderPathTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to get a folder where to search for lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFolderPathTemplate</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>FileNameTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to distinguish lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFileNameTemplate</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the name of a computer to test.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies for which types of locks to look.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FolderPathTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to get a folder where to search for lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFolderPathTemplate</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>FileNameTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to distinguish lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFileNameTemplate</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Boolean</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> Test-HostResourceLock -ComputerName SRV01 -Type Host</dev:code> <dev:remarks> <maml:para>Tests if SRV01 has a lock of the "Host" type on it.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Test-HostResourceLock -ComputerName SRV01</dev:code> <dev:remarks> <maml:para>Tests if SRV01 has any lock on it.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Test-HostResourceLock.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Unlock-Resource</command:name> <command:verb>Unlock</command:verb> <command:noun>Resource</command:noun> <maml:description> <maml:para>Unlocks a resource/host.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>THe function allow you to gracefully unlock a network resource. The main purpose of such unlock is to maintain history of locks: it's implemented by utilizing a history folder on each host where disengaged lock files are moved. When the function disengages a lock file, it writes the current time in it so you can keep track of locks on a host.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Unlock-Resource</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>LockObject</maml:name> <maml:Description> <maml:para>The lock object you would like to disengage.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">FileInfo[]</command:parameterValue> <dev:type> <maml:name>FileInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>HistoryFolderName</maml:name> <maml:Description> <maml:para>Specifies the name of a folder where to put a disengaged lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockHistoryFolderName</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FileNameTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to distinguish lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFileNameTemplate</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>LockObject</maml:name> <maml:Description> <maml:para>The lock object you would like to disengage.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">FileInfo[]</command:parameterValue> <dev:type> <maml:name>FileInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>HistoryFolderName</maml:name> <maml:Description> <maml:para>Specifies the name of a folder where to put a disengaged lock.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockHistoryFolderName</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>FileNameTemplate</maml:name> <maml:Description> <maml:para>Specifies the template which is used to distinguish lock files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$ModuleWideLockFileNameTemplate</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.IO.FileInfo[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>## RELATED LINKS</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $Lock | Unlock-Resource</dev:code> <dev:remarks> <maml:para>Unlocks a resource based on a lock object passed through the pipeline.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Unlock-Resource -LockObject $Lock Unlocks a resource based on a lock object passed directly into the parameter.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/FozzyHosting/ResourceLocker/blob/master/docs/Unlock-Resource.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |