mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-05 20:39:38 +01:00
Merge branch 'master' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
695e87cb04
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script changes the working directory to the user's Git repositories folder.
|
This PowerShell script changes the working directory to the user's Git repositories folder.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-repos
|
PS> ./cd-repos
|
||||||
📂C:\Users\Markus\source\repos
|
📂C:\Users\Markus\Repos
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -13,12 +13,14 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux) {
|
if (Test-Path "$HOME/Repos" -pathType Container) {
|
||||||
$Path = Resolve-Path "$HOME/Repos"
|
$Path = Resolve-Path "$HOME/Repos"
|
||||||
} else {
|
} elseif (Test-Path "$HOME/Repositories" -pathType Container) {
|
||||||
|
$Path = Resolve-Path "$HOME/Repositories"
|
||||||
|
} elseif (Test-Path "$HOME/source/repos" -pathType Container) {
|
||||||
$Path = Resolve-Path "$HOME/source/repos"
|
$Path = Resolve-Path "$HOME/source/repos"
|
||||||
}
|
} else {
|
||||||
if (-not(Test-Path "$Path" -pathType container)) {
|
$Path = "$HOME/Repos"
|
||||||
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
|
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
|
||||||
}
|
}
|
||||||
Set-Location "$Path"
|
Set-Location "$Path"
|
||||||
|
@ -23,22 +23,22 @@ function Test-RegistryValue { param([parameter(Mandatory=$true)][ValidateNotNull
|
|||||||
$Reason = ""
|
$Reason = ""
|
||||||
|
|
||||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") {
|
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") {
|
||||||
$Reason += ", found registry entry: '...\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired'"
|
$Reason += ", found registry entry '...\WindowsUpdate\Auto Update\RebootRequired'"
|
||||||
}
|
}
|
||||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") {
|
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") {
|
||||||
$Reason += ", found registry entry: '...\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting'"
|
$Reason += ", found registry entry '...\WindowsUpdate\Auto Update\PostRebootReporting'"
|
||||||
}
|
}
|
||||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") {
|
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") {
|
||||||
$Reason += ", found registry entry: '...\Windows\CurrentVersion\Component Based Servicing\RebootPending'"
|
$Reason += ", found registry entry '...\Component Based Servicing\RebootPending'"
|
||||||
}
|
}
|
||||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") {
|
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") {
|
||||||
$Reason += ", found registry entry: '...\Microsoft\ServerManager\CurrentRebootAttempts'"
|
$Reason += ", found registry entry '...\ServerManager\CurrentRebootAttempts'"
|
||||||
}
|
}
|
||||||
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") {
|
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") {
|
||||||
$Reason += ", found registry entry: '...\Windows\CurrentVersion\Component Based Servicing' with 'RebootInProgress'"
|
$Reason += ", found registry entry '...\CurrentVersion\Component Based Servicing' with 'RebootInProgress'"
|
||||||
}
|
}
|
||||||
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") {
|
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") {
|
||||||
$Reason += ", found registry entry: '...\Windows\CurrentVersion\Component Based Servicing' with 'PackagesPending'"
|
$Reason += ", found registry entry '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'"
|
||||||
}
|
}
|
||||||
#if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations") {
|
#if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations") {
|
||||||
# $Reason += ", found registry entry '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations'"
|
# $Reason += ", found registry entry '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations'"
|
||||||
|
Loading…
Reference in New Issue
Block a user