mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-25 05:23:58 -07:00 
			
		
		
		
	Fix the markdown used for the Windows module section
This commit is contained in:
		
					parent
					
						
							
								30e729557f
							
						
					
				
			
			
				commit
				
					
						fe72fff57d
					
				
			
		
					 1 changed files with 14 additions and 4 deletions
				
			
		|  | @ -538,24 +538,34 @@ Windows modules checklist | ||||||
| 
 | 
 | ||||||
|     #!powershell |     #!powershell | ||||||
| 
 | 
 | ||||||
| then:: |   then:: | ||||||
|  | 
 | ||||||
|     <GPL header> |     <GPL header> | ||||||
| then:: | 
 | ||||||
|  |   then:: | ||||||
|  | 
 | ||||||
|     # WANT_JSON |     # WANT_JSON | ||||||
|     # POWERSHELL_COMMON |     # POWERSHELL_COMMON | ||||||
|      |      | ||||||
| then, to parse all arguments into a variable modules generally use:: |   then, to parse all arguments into a variable modules generally use:: | ||||||
|  | 
 | ||||||
|     $params = Parse-Args $args |     $params = Parse-Args $args | ||||||
| 
 | 
 | ||||||
| * Arguments: | * Arguments: | ||||||
|     * Try and use state present and state absent like other modules |     * Try and use state present and state absent like other modules | ||||||
|     * You need to check that all your mandatory args are present. You can do this using the builtin Get-AnsibleParam function.  |     * You need to check that all your mandatory args are present. You can do this using the builtin Get-AnsibleParam function.  | ||||||
|     * Required arguments:: |     * Required arguments:: | ||||||
|  | 
 | ||||||
|         $package =  Get-AnsibleParam -obj $params -name name -failifempty $true |         $package =  Get-AnsibleParam -obj $params -name name -failifempty $true | ||||||
|  | 
 | ||||||
|     * Required arguments with name validation:: |     * Required arguments with name validation:: | ||||||
|  | 
 | ||||||
|         $state = Get-AnsibleParam -obj $params -name "State" -ValidateSet "Present","Absent" -resultobj $resultobj -failifempty $true |         $state = Get-AnsibleParam -obj $params -name "State" -ValidateSet "Present","Absent" -resultobj $resultobj -failifempty $true | ||||||
|  | 
 | ||||||
|     * Optional arguments with name validation:: |     * Optional arguments with name validation:: | ||||||
|  | 
 | ||||||
|         $state = Get-AnsibleParam -obj $params -name "State" -default "Present" -ValidateSet "Present","Absent" |         $state = Get-AnsibleParam -obj $params -name "State" -default "Present" -ValidateSet "Present","Absent" | ||||||
|  | 
 | ||||||
|     * the If "FailIfEmpty" is true, the resultobj parameter is used to specify the object returned to fail-json. You can also override the default message  |     * the If "FailIfEmpty" is true, the resultobj parameter is used to specify the object returned to fail-json. You can also override the default message  | ||||||
|       using $emptyattributefailmessage (for missing required attributes) and $ValidateSetErrorMessage (for attribute validation errors) |       using $emptyattributefailmessage (for missing required attributes) and $ValidateSetErrorMessage (for attribute validation errors) | ||||||
|     * Look at existing modules for more examples of argument checking. |     * Look at existing modules for more examples of argument checking. | ||||||
|  | @ -586,7 +596,7 @@ Starting in 1.8 you can deprecate modules by renaming them with a preceding _, i | ||||||
| _old_cloud.py, This will keep the module available but hide it from the primary docs and listing. | _old_cloud.py, This will keep the module available but hide it from the primary docs and listing. | ||||||
| 
 | 
 | ||||||
| You can also rename modules and keep an alias to the old name by using a symlink that starts with _. | You can also rename modules and keep an alias to the old name by using a symlink that starts with _. | ||||||
| This example allows the stat module to be called with fileinfo, making the following examples equivalent | This example allows the stat module to be called with fileinfo, making the following examples equivalent:: | ||||||
| 
 | 
 | ||||||
|     EXAMPLES = ''' |     EXAMPLES = ''' | ||||||
|     ln -s stat.py _fileinfo.py |     ln -s stat.py _fileinfo.py | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue