Skip to content

Commit

Permalink
Bug fixes 1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Koskivaara committed Jan 15, 2020
1 parent 8197a06 commit b1358ce
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,42 @@

Powershell module for ServiceNow MID server installation

| Version | Info | Date |
| ------- | ----------------------- | ---------- |
| 1.1 | Initial working release | 15.01.2020 |

## Commands

| Command | Info |
| ----------------------------- | -------------------------------------------------- |
| `Install-ServiceNowMIDServer` | Downloads and installs ServiceNow MID server agent |

## Usage

- Create MID server user in ServiceNow to table `sys_user` and add MID server role to it
- Login to your Windows 2016/2019 server that is going to be your MID server
- Open Powershell terminal at the MID server
- Install Powershell ServiceNow MID server module and MID server agent by typing these commands in the Powershell shell:

```Powershell
Install-Module -Name ServiceNow-MIDServer
Install-ServiceNowMIDServer -ServiceNowInstanceName <string> -Name <string> -Credential <PSCredential>
```

- Note that if script execution policy is set to disabled you must first enable it by typing this command:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

- Installer will prompt your ServiceNow MID server user credentials if you haven't provided PSCredential object for it
- Enter MID server user credentials and wait until the script downloads the agent and installs it, agent is around 200-300 MBs in size
- Validate the MID server in ServiceNow

### Example

```powershell
Install-Module -Name ServiceNow-MIDServer
Install-ServiceNowMIDServer -ServiceNowInstanceName 'dev78602' -Name 'AzureMIDServer' -Credential (Get-Credential)
```
2 changes: 1 addition & 1 deletion ServiceNow-MIDServer/ServiceNow-MIDServer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'ServiceNow-MIDServer.psm1'

# Version number of this module.
ModuleVersion = '1.0'
ModuleVersion = '1.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
15 changes: 13 additions & 2 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# For local Windows workstation usage only
# TODO: Create generic publisher for GitHub actions CI/CD

$moduleName = 'ServiceNow-MIDServer'
$moduleRoot = "$($env:SystemDrive)\Users\$($env:USERNAME)\Documents\PowerShell\Modules"
Copy-Item -Path '.\ServiceNow-MIDServer' -Destination $moduleRoot -Recurse -Force
Publish-Module -Name "ServiceNow-MIDServer" -NuGetApiKey $env:POWERSHELL_GALLERY_API_KEY

$moduleSrcPath = Join-Path -Path $PSScriptRoot -ChildPath $moduleName
$configFilePath = Join-Path -Path $moduleSrcPath -ChildPath "$($moduleName).psd1"

$config = Import-PowerShellDataFile $configFilePath

$installPath = Join-Path -Path (Join-Path $moduleRoot $moduleName) -ChildPath $config.ModuleVersion
Copy-Item -Path $moduleSrcPath -Destination $installPath -Recurse -Force
Publish-Module -Name $moduleName -NuGetApiKey $env:POWERSHELL_GALLERY_API_KEY

0 comments on commit b1358ce

Please sign in to comment.