File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Playground
Original file line number Diff line number Diff line change @@ -144,3 +144,12 @@ Git-NumberedUnhidden # alias: gunhide
144144``` powershell
145145Publish-Module -Path .\ -NuGetApiKey key
146146```
147+
148+
149+ ## Random Repository
150+
151+ Create a repository with some random files/changes in directory ` Playground ` .
152+
153+ ``` ps1
154+ ./create-random-repo.ps1
155+ ```
Original file line number Diff line number Diff line change 1+ $repoPath = " Playground"
2+ New-Item - ItemType Directory - Path $repoPath | Out-Null
3+ Push-Location $repoPath
4+
5+ git init | Out-Null
6+
7+ @ (
8+ @ { Name = " README.md" ; Content = " # Demo Repository`n This is a demo repo created by PowerShell." },
9+ @ { Name = " app.txt" ; Content = " Version 1.0`n Hello World" },
10+ @ { Name = " config.json" ; Content = ' { "version": "1.0", "enabled": true }' },
11+ @ { Name = " .gitignore" ; Content = ' node_modules' },
12+ @ { Name = " HOW TO.md" ; Content = ' HOW TO`n======' }
13+ ) | ForEach-Object {
14+ Set-Content - Path $_.Name - Value $_.Content
15+ }
16+
17+ git add .
18+ git commit - m " Initial commit with demo files"
19+
20+ Add-Content - Path " app.txt" - Value " `n Feature added at $ ( Get-Date ) "
21+ (Get-Content " config.json" ) -replace ' "enabled": true' , ' "enabled": false' | Set-Content " config.json"
22+ Add-Content - Path " HOW TO.md" - Value " `n Just do it"
23+
24+ git add app.txt
25+
26+ Pop-Location
27+
28+ echo " Check out the mega dummy repository:"
29+ echo " cd Playground"
You can’t perform that action at this time.
0 commit comments