Install Neo4j 3.0+ as a windows service - powershell

Anyone tried installing neo4j version 3 in windows as a service? I tired neo4j community version 3.1.0 and 3.2.0 alpha. I am getting following error when try to start the service.
Invoke-Neo4j : Failed to start service 'Neo4j Graph Database - neo4j (neo4j)'. At line:1 char:211 + ... t.psd1'; Exit (Invoke-Neo4j start) + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Neo4j

Was able to run as a windows service by running this script with nssm.
powershell.exe -Command "Import-Module C:\Neo4j\bin\Neo4j-Management.psd1; Invoke-Neo4j console"

I was facing the same issue and got resolved in this way:
you have to run your PowerShell as admin:
set NEO4J_HOME D:\neo4j-community-3.3.0 {Change it to your installation directory}
Go to your installation directory:
./bin/neo4j.bat install-service {when you are starting your server for the first time}
./bin/neo4j.bat start
Screen shot of my powershell

Related

Unrea Engine Pixel Streaming Prepare Signalling Server in Power Shell

I am following this instruction [Link][1] on Unreal Documentation
But stuck at 2nd point Start the Servers
To prepare for the Signalling Server, start by opening PowerShell as
Administrator and running
SignallingWebServer\platform_scripts\cmd\setup.ps1.
In Power Shell I m getting error
PS C:\Windows\system32> SignallingWebServer\platform_scripts\cmd\setup.ps1
SignallingWebServer\platform_scripts\cmd\setup.ps1 : The module 'SignallingWebServer' could not be loaded. For more
information, run 'Import-Module SignallingWebServer'.
At line:1 char:1
+ SignallingWebServer\platform_scripts\cmd\setup.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (SignallingWebSe...s\cmd\setup.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoLoadModule
I want to pixel streaming the unreal engine project to veiw in web browser
[1]: https://docs.unrealengine.com/5.0/en-US/getting-started-with-pixel-streaming-in-unreal-engine/

Publish-Module fails with NuGet.Build.Tasks.Pack.targets(198,5) error : Index was outside the bounds of the array

I've upgraded to dotnet sdk version 3.1 and am trying to publish my powershell module. I am using powershell 5.1.
I run the command:
Publish-Module -Path "C:\sources\myModules\InstallationUtils\" -NuGetApiKey "xxxxxxx" -Repository internal.packages.org"
and get the error:
[C:\Users\xxxxxx\AppData\Local\Temp\469d7c83-6e1a-4366-b948-6a415b0279be\Temp.csproj]
Successfully created package
'C:\Users\xxxxxx\AppData\Local\Temp\158464074\myModules\InstallationUtils\InstallationUtils.1.4.8.nupkg'.
C:\Program Files\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error :
Index was outside the bounds of the array.
[C:\Users\xxxxxx\AppData\Local\Temp\469d7c83-6e1a-4366-b948-6a415b0279be\Temp.csproj]
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.1\PSModule.psm1:10944 char:17
+ ... Publish-PSArtifactUtility #PublishPSArtifactUtility_Param ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility
Is anyone have similar issues and managed to fix it?
thanks
I have a work around, which involves replacing the old version of version nuget.exe in
C:\Users\xxxxx\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\
with the latest version of nuget.exe .
I found the work around on SQLDBAWithABeard but I am hoping that there is a better solution than this?

Trouble installing Powercli 11.x

Easing back into Windows after a 3-4 year MacOS hiatus. Powershell has come a long way but I am running into some errors I can't figure out here.
Every article I see on installing the newer PowerCLI is rather simple. Use a package manager to download/install it and off you run. Not for me, I'm getting the following error when trying to run Install-Module -Name VMware.PowerCLI:
PackageManagement\Install-Package : Unable to find dependent module(s) (VMware.VimAutomation.Cis.Core)
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.0.4\PSModule.psm1:9307 char:21
+ ... $null = PackageManagement\Install-Package #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (VMware.VimAutomation.Cis.Core:String) [Install-Package], Exception
+ FullyQualifiedErrorId : UnableToFindDependencyPackage,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
I have tried this on two Windows machines and even with Powershell Core on a Mac. Same issue every time. What am I missing and/or doing wrong?

How do I correctly install the PowerShell MSOnline module in Windows 8.1 Enterprise?

I'm trying to write some scripts for Azure Active Directory / Office online, and I'm completely unable to install the MSOnline powershell module. I've installed the Office Sign In Assistant version 7.2 (64-bit for my 64-bit machine). When I try to run the MSI installer for the PowerShell module, it says it can't find the sign in assistant. When I install the powershell module through PowerShellGet, and then run the commands, it fails with:
Connect-MsolService : The Microsoft Online Services Module is not configured properly. Please uninstall and then reinstall the module.
At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], InvalidConfigurationException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InvalidConfigurationException,Microsoft.Online.Administration.Automation.ConnectMsolService
Connect-MsolService : Object reference not set to an instance of an object.
At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Online.Administration.Automation.ConnectMsolService
Is there any way to get this installed ? I've even changed the language of my system to US-English and installed the correct language pack (because I've run into issues before with things not installing correctly if the system language is not US English)
Found at least a partial answer here that worked (at least got the module working again for one of my accounts, the other one still fails and remains a mystery):
MSOnline can't be imported on PowerShell (Connect-MsolService error)
In my case, some registry keys were missing (I don't know why) and reinstalling didn't help. I imported the registry keys with one path adaption from another system and now it works. I used the following registry keys (just copy to a file powershell.reg, change InstallPath if necessary, and import):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOnlinePowerShell]
"Version"="1.0.0"
"InstallPath"="c:\\Program Files\\WindowsPowerShell\\Modules\\MSOnline\\1.0\\"
"InstallLanguage"="en-us"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOnlinePowerShell\Path]
"WebServiceUrl"="https://provisioningapi.microsoftonline.com/provisioningwebservice.svc"
"FederationProviderIdentifier"="microsoftonline.com"
Follow the steps to install the Azure AD Module here

Can't change neo4j database location

Neo4j version: Community Edition 2.3.2
Starting neo4j ce 2.3.2 by provided visual tool works correct while using a custom DB directory.
For example:
database location: C:\Neo4jDB
database tuning file: C:\Neo4jDB\neo4j.properties
server configuration file: C:\Users\leo\AppData\Roaming\Neo4j Community Edition\neo4j-server.properties
here I set: org.neo4j.server.database.location="C:/Neo4jDB"
Starting neo4j ce 2.3.2 by Windows PowerShell works correct ONLY if I use default configuration (data/graph.db), but if I change C:\Neo4j\conf\neo4j-server.properties file setting to
org.neo4j.server.database.location="C:/Neo4jDB"
(like while using provided visual tool) Windows PowerShell rises the following error:
Start-Service : Service 'Neo4JLEO (Neo4JLEO)' cannot be started due to the
following error: Cannot start service Neo4JLEO on computer '.'.
At C:\neo4j\bin\Neo4j-Management\Start-Neo4jServer.ps1:142 char:30
+ $result = Start-Service <<<< -Name $ServiceName -PassThru
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
Windows uses back-slashes as path delimiters. Try replacing the forward-slash in your configuration with back-slash.
I.e. org.neo4j.server.database.location="C:\Neo4jDB"
Actually previous answer is partially correct. Windows uses "\", but the neo4j.conf file should have "c:\\Neo4jDB" (double slash) in it. That is what I am using, this way the service is able to start.
It has nothing to do with powershell limitations, the manually starting it from services.msg will present same error. It has more to do with service vs application (what you call visual tool).