Esri / arcgis-powershell-dsc

This repository contains scripts, code and samples for automating the install and configuration of ArcGIS (Enterprise and Desktop) using Microsoft Windows PowerShell DSC (Desired State Configuration).
Apache License 2.0
118 stars 62 forks source link

Secure - "Disconnected Environment" #207

Open CliveSW-online opened 5 years ago

CliveSW-online commented 5 years ago

Apologies if this is a dummy question.

We are doing a Base Deployment in a secure and "Disconnected Environment" that does not have access to any external resources, internet...blagh...blagh.

I was reading through the help documents for downloading PowerShell Module for Server Offline. If I understood the documents you have a choice of setting-up a NuGet.server or an offline repository.

The pros and cons of NuGet.server vs offline repository. Suggested that the offline repository can't process the xml required to install to do a "disconnected" Base deployment??? In the following article, Working with local PowerShellGet Repositories: https://docs.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-local-psrepositories?view=powershell-6

Is this correct or am I missing something??? So you have to set-up a NuGet.serve in order to do a PowerShell Base Deployment??

Thanks,

Clive

CliveSW-online commented 5 years ago

I was unable to edit above to add a follow-up question.

If you are working in a and secure and "Disconnected Environment" is Chef or PowerShell environment the better solution??

nshampur commented 5 years ago

@CliveSW-online - there are easier ways to get the ArcGIS Module on a machine. Essentially a x-copy of the module into the PowerShell module folder should do the trick. This location is typically in Program Files/PowerShell/Modules

CliveSW-online commented 5 years ago

Apologies, perhaps my question wasn't clear. I wasn't able to edit/update the question.

1) For PowerShell to work on a secure and "Disconnected Environment, do you have to install NuGet.server??

2) Does Chef or Powershell work better in an automated Base Deployment working in a secure and "Disconnected Environment??

Clives-online commented 5 years ago

On the on-line machine there are two repositories: Get-PSRepository

Name InstallationPolicy SourceLocation


PSGallery Trusted https://www.powershellgallery.com/api/v2
LocalPSRepo Trusted F:\localhost\PSRepoLocal\

I copied LocalPSRepo to the server in a disconnected environment. I have a number of packages listed: PowerShellGet and NuGet

But I get an error asking me to install NuGet??

durbach commented 5 years ago

@Clives-online @CliveSW-online You don't need to use NuGet Server. You'll need to get the NuGet provider and nuget.exe onto the disconnected machine. Check out: https://docs.microsoft.com/en-us/powershell/scripting/gallery/how-to/getting-support/bootstrapping-nuget?view=powershell-6#manually-bootstrapping-nugetexe-to-support-publish-operations-on-a-machine-that-is-not-connected-to-the-internet

These are the steps I used to get Install-Module working with a local repository in a disconnected environment:

  1. On a connected machine, Run the following command in Powershell: Install-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201 -Force
  2. From the connected machine, copy the following folder to the same location on the disconnected machine: C:\Program Files\Packagemanagement\ProviderAssemblies\NuGet
  3. On the connected machine, download the recommended version of nuget.exe from https://www.nuget.org/downloads and copy that to C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet on the disconnected machine
  4. On the disconnected machine, run the following command to register nuget: Import-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201
  5. Confirm NuGet is available as a package provider with this command: Get-PackageProvider -ListAvailable
  6. Create a local PSRepository with the following command: Register-PSRepository -Name [repo name] -SourceLocation [local or UNC path to folder] -InstallationPolicy Trusted
  7. Publish the ArcGIS module to this repository with the following command: Publish-Module -Path [path to arcgis module] -Repository [repo name from step 6]
  8. Confirm the module is available in the repository with this command: Find-Module -Repository [repo name]
  9. Finally, to install the ArcGIS module from this local repository, run this command: Install-Module ArcGIS

Hope that helps!

github-actions[bot] commented 4 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.