- Jenkins mac network drive script how to#
- Jenkins mac network drive script mac os x#
- Jenkins mac network drive script install#
You now know how to run “complex” PowerShell scripts with Jenkins. In the Build part, you must configure a PowerShell command.
So that you can imagine in Jenkins what it looks like here is a screenshot of a script block and a script in. To run a PowerShell script (.ps1), drop the file on the Jenkins server and then use Invoke-Commad to run the script.Īs you can see, after Invoke-Command, we use the -FilePath parameter, which takes as value the location of the script on the Jenkins server and we end with the -Session parameter which takes the variable containing the remote session $RemoteSession.
Jenkins mac network drive script mac os x#
Whether for a script block or a file, you must first declare the remote connection:Īs you can see, after Invoke-Command, we use the -ScriptBlock parameter, then the PowerShell code and we end with the -Session parameter which takes the variable containing the remote session $RemoteSession. The drive will now appear on your desktop and in the Finder window sidebar Map a network drive to Mac OS X that re-mounts after system reboot. ps1 file which contains the script, you must use the parameter -FilePath.īefore showing you in Jenkins how to do this, here is how the code will appear.
If you want to run more complex commands or scripts, you are faced with the Double-Hop problem, this problem is not related to Jenkins but to the use of remote session in PowerShell. If you followed the first tutorial, I showed you how to run “simple” PowerShell cmdlets.
Jenkins mac network drive script install#
Unlike installed hardware, such as your RAM, macOS does not automatically detect network devices we need to install them and set them up before we can use them. To complete the tutorial on Jenkins where I explain how to use it to run scheduled tasks and therefore turn it into a scheduler, I will show you in this tutorial, how to run PowerShell scripts. Mapping a network drive is the process of linking your Mac to a network-attached storage device.