diff --git a/Deployment/cloudbase-init/userdata/Sample.ps1 b/Deployment/cloudbase-init/userdata/Sample.ps1 new file mode 100644 index 0000000..878106c --- /dev/null +++ b/Deployment/cloudbase-init/userdata/Sample.ps1 @@ -0,0 +1,24 @@ +Import-Module CoreFunctions + +$ModuleBase = "C:\Keero\Modules" + + +$NewModule_Name = "ModuleName" +$NewModule_Base64 = @' +%BASE64_STRINGS% +'@ + + +$AgentConfig_Path = "C:\Keero\Agent\WindowsAgent.exe.config" +$AgentConfig_Base64 = @' +%AGENT_CONFIG_BASE64% +'@ + + +ConvertFrom-Base64String -Base64String $NewModule_Base64 -Path "$ModuleBase\$NewModule_Name.zip" +Remove-Item -Path "$ModuleBase\$NewModule_Name" -Recurse -Force +Expand-Zip -Path "$ModuleBase\$NewModule_Name.zip" -Destination "$ModuleBase\$NewModule_Name" + + +Remove-Item -Path $AgentConfig_Path -Force +ConvertFrom-Base64String -Base64String $NewModule_Base64 -Path $AgentConfig_Path