January 29, 2020 at 1:49 pm #200618ParticipantTopics: 17Replies: 24Points: 80Rank: Member
Could someone please help with a little guidance.
I recently built approximately 14 functions (12 public/ 2 private), however now i would like to create scheduled task on each server to execute the functions, then output the data to a sql database.
I thought just create a control script to do this however i was wondering where i should store this?
Inside a module folder or separate?
Should i create a separate module imports the first module, creates a scheduled task on the server?
Any suggestion or help would be greatly appreciated.
January 29, 2020 at 3:20 pm #200663ParticipantTopics: 12Replies: 1642Points: 2,660Rank: Community Hero
IMHO, you should keep the module and the script separate. If you set up an internal repository, then you can host a module and script in a central location:
Then you can create a script on your worker servers that will automatically update the module and script during execution:
Task 1: Get the latest script
Task 2: Execute PS1, something like:
Install-Module -Name MyModule -Repository MyRepository -Scope CurrentUser Import-Module MyModule $stuff = Get-MyModuleStuff Invoke-SqlCmd ...
- The topic ‘Controller Script & Module’ is closed to new replies.