How to do it...

The PowerShell crontab wrapper module is not available in the PowerShell repository as yet. You must download the files manually to install the module. The simplest way is to clone the PowerShell repository and install the module from within its demos directory.

If you would rather only install the CronTab module alone, download the <repo>/demos/crontab directory manually. Then, start PowerShell as super-user, and navigate to crontab. Continue from step 4.
  1. Clone the PowerShell repository on to your computer.
$ mkdir ~/code
$ git clone https://github.com/PowerShell/PowerShell.git
  1. Start pwsh as a super-user.
  2. Go to the demos/crontab/CronTab directory within the repository. This is where the module manifest is placed.
PS> Set-Location ~/code/PowerShell/demos/crontab
  1. Use the Import-Module cmdlet on the module manifest to import the module.
PS> Import-Module -Name ./CronTab/CronTab.psd1
  1. To list the components of CronTab module use the Get-Module cmdlet.
PS> Get-Module -Name CronTab | Format-List
Name : CronTab
Path : /home/PacktPub/CronTab.psm1
Description :
ModuleType : Script
Version : 0.0
NestedModules : {}
ExportedFunctions : {ConvertTo-CronJob, Get-CronJob, Get-CronTab, Get-CronTabUser...}
ExportedCmdlets :
ExportedVariables :
ExportedAliases :
  1. To list the available command types of CronTab module use  the Get-Command cmdlet.
PS> Get-Command -Module CronTab  
CommandType Name Version Source
----------- ---- ------- ------
Function ConvertTo-CronJob 0.0 CronTab
Function Get-CronJob 0.0 CronTab
Function Get-CronTab 0.0 CronTab
Function Get-CronTabUser 0.0 CronTab
Function Import-CronTab 0.0 CronTab
Function Invoke-CronTab 0.0 CronTab
Function New-CronJob 0.0 CronTab
Function Remove-CronJob 0.0 CronTab
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.234.62