Skip to content

Commit

Permalink
Added instructions on how to setup local file based repo
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Aug 23, 2024
1 parent 8403371 commit f664f01
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PublishOnLocalRepo.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$localRepoPath="C:\Users\Administrator\source\repos\NuGetServerApp\NuGetServerApp\Packages\"
$localRepoPath="C:\Workspace\LocalRepo\LocalPSRepo\Packages\"
$powerShellPackage=$localRepoPath+"Cohesity.PowerShell"
$powerShellCorePackage=$localRepoPath+"Cohesity.PowerShell.Core"
Remove-Item -Recurse -Force $powerShellPackage
Expand Down
13 changes: 13 additions & 0 deletions src/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Instructions

## Setting up local repo
- Create a directory `C:\Workspace\LocalRepo\LocalPSRepo\Packages\`. This directory will hold all the PS packages hosted locally.
- Update the location of the directory in `Register-LocalPSRepo.ps1` powershell script.
- Execute the script `src\Register-LocalPSRepo.ps1` to register the `LocalPSRepo` repository.

## UnRegister local repo
- Execute the command `UnRegister-PSRepository <repo-name>`

## Publish local change to the local repo
- To publish changes to local repo created above, execute the ps script `src\PublishOnLocalRepo.ps1`
- Ensure you update the `$localRepoPath` variable in the above script to the LocalPSRepo package directory location.
8 changes: 8 additions & 0 deletions src/Register-LocalPSRepo.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Register a NuGet-based server
$registerPSRepositorySplat = @{
Name = 'LocalPSRepo'
SourceLocation = 'C:\Workspace\LocalRepo\LocalPSRepo\Packages\'
ScriptSourceLocation = 'C:\Workspace\LocalRepo\LocalPSRepo\Packages\'
InstallationPolicy = 'Trusted'
}
Register-PSRepository @registerPSRepositorySplat

0 comments on commit f664f01

Please sign in to comment.