]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Merge.
authorEdTheDev <edward@delaporte.us>
Mon, 17 May 2021 03:52:19 +0000 (22:52 -0500)
committerEdTheDev <edward@delaporte.us>
Mon, 17 May 2021 03:52:19 +0000 (22:52 -0500)
Microsoft.PowerShell_profile.ps1
psmodules/dash.psm1 [new file with mode: 0644]
psmodules/drivespace.psm1
psmodules/github.psm1 [new file with mode: 0644]
setup/disable-hyper-v.ps1 [new file with mode: 0644]
setup/powershell.ps1
vimrc

index 355f90fc71206279cfb1e57c77ba9a4de924c246..eed9141e1b6090431099e0951a3f18f005c1fcf2 100644 (file)
@@ -9,7 +9,7 @@
 # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
 
 # No longer needed in PowerShell 7
-if($IsWindows -eq "") {
+if(-Not $IsWindows) {
        # Bootstrap for older PowerShell
        Write-Host "***Bootstrapped Is Windows for older PowerShell***"
        $IsWindows = ($env:OS -eq "Windows_NT")
@@ -90,3 +90,14 @@ New-Alias x16   Invoke-X16Emu
 if((Get-Location).Path -eq $HOME){
        cd $env:src
 }
+
+function Get-GitLog() {
+       git log --oneline
+}
+
+function Get-GitStatus() {
+       git status -b --short
+}
+
+New-Alias ol           Get-GitLog
+New-Alias st           Get-GitStatus
\ No newline at end of file
diff --git a/psmodules/dash.psm1 b/psmodules/dash.psm1
new file mode 100644 (file)
index 0000000..560f729
--- /dev/null
@@ -0,0 +1,19 @@
+
+function Get-MyDashboard() {
+  $MyDashboard = New-UDDashboard -Title "Hello, World" -Content {
+    New-UDCard -Title "Hello, Universal Dashboard" -Content {
+      New-UDParagraph -Text 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.'
+    } -Links @(
+      New-UDLink -Text 'This is a link' -Url '#!'
+      New-UDLink -Text 'This is a link' -Url '#!'
+      ) -Size 'small'
+    }
+  return $MyDashboard
+}
+
+function Inovke-MyDashboard() {
+  Start-UDDashboard -Port 1000 -Dashboard Get-MyDashboard
+  Write-Host "http://localhost:1000"
+}
+
+Export-ModuleMember -Function Invoke-MyDashboard
\ No newline at end of file
index 59feb96d962c377038de904e7a1c58eb8f3fb4f3..19fdc5e5b6648efb75c1737e5eb6547c5209f30c 100644 (file)
@@ -21,6 +21,21 @@ function Show-Drivespace() {
        }
 }
 
+function Show-DrivespacePretty() {
+       Start-Job -Name "FileCollection" -ScriptBlock { Show-Drivespace }
+While((Get-Job -Name "FileCollection").State -eq "Running") {
+            Write-Progress -Activity "Collecting Files..." -PercentComplete $x
+       If($x -eq 100){
+               $x = 1
+       }
+       Else{
+               $x += 1
+       }
+}
+Write-Progress -Activity "Collecting Files..." -Completed
+$Files = Get-Job -Name "FileCollection" | Receive-Job
+Get-Job -Name "FileCollection" | Remove-Job
+}
 
 Export-ModuleMember -Function Show-Drivespace 
 Export-ModuleMember -Function Show-LargeFiles
diff --git a/psmodules/github.psm1 b/psmodules/github.psm1
new file mode 100644 (file)
index 0000000..0f26e24
--- /dev/null
@@ -0,0 +1,43 @@
+<#
+.SYNPOSIS
+
+Fetch closed GitHub issues that were updated in the last 14 days.
+
+#>
+function Get-GHClosed {
+  param(
+    [int]$days = -14
+  )
+  $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login')
+  $issueSearchParams = @{ State = 'closed'; OwnerName = 'techservicesillinois' }
+  $closed = @()
+  $repos | ForEach-Object { 
+    $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams
+  }
+
+  # Limit to past two weeks
+  $issues = $closed | Where-Object { $_.updated_at -gt (Get-Date).AddDays($days) }
+  return $issues
+}
+
+
+<#
+.SYNOPSIS
+
+Show closed GitHub issues that were updated in the last 14 days.
+
+#>
+function Show-GHClosed() {
+  param(
+    [int]$days = -14
+  )
+  Get-GHClosed -days $days | ForEach-Object {
+    # Markdown output
+    " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")"
+  }
+  # Format-Table -Property Number, Title, Url
+
+}
+
+Export-ModuleMember -Function Get-GHClosed
+Export-ModuleMember -Function Show-GHClosed
\ No newline at end of file
diff --git a/setup/disable-hyper-v.ps1 b/setup/disable-hyper-v.ps1
new file mode 100644 (file)
index 0000000..4a8ea03
--- /dev/null
@@ -0,0 +1,5 @@
+Write-Host "Recipe to help VMWare play nice."
+Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor
+bcdedit /set hypervisorlaunchtype off # auto to turn back on
+Write-Host "Start - GPEdit - Computer Configuration -> Administrative Templates -> System -> Device Guard - Turn on Virtualization Based Security"
+Write-Host "You may need to restart."
\ No newline at end of file
index 6dffb0f32317cd191e756a3a3c69de1667524b15..365629b6bfb5e0ea3317823127214775b20ec7d4 100755 (executable)
@@ -1,3 +1,5 @@
 Write-Host "Require remote scripts to be signed."\r
 Set-ExecutionPolicy RemoteSigned\r
+Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # Trust PowerShell Gallery\r
 Install-Module posh-git\r
+Install-Module -Name PowerShellForGitHub
\ No newline at end of file
diff --git a/vimrc b/vimrc
index b212fb0fff134c574206db2bf4ed40597f97ef9b..712d0c0b3245ec20a6bfbaa520ad5ee9b27d66f4 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -74,8 +74,7 @@ au BufNewFile,BufRead *.go set noet ts=2 sw=2 sts=2
 " Working with Markdown
 
 au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
-colorscheme slate
-" colorscheme papercolor
+colorscheme elflord
 set number
 
 set backupdir=c:\temp,.backup/,~/.backup/,/tmp//