mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-23 05:01:37 +01:00
Add cd-autostart.ps1
This commit is contained in:
parent
1bb7b22b27
commit
840dd7f3cc
@ -3,24 +3,25 @@ add-firewall-rules.ps1, Adds firewall rules to the given executables (needs admi
|
||||
add-memo.ps1, Adds the given memo text to $HOME/Memos.csv
|
||||
build-repo.ps1, Builds a Git repository
|
||||
build-repos.ps1, Builds all Git repositories in a folder
|
||||
cd-desktop.ps1, Change the working directory to the user's desktop folder
|
||||
cd-docs.ps1, Change the working directory to the user's documents folder
|
||||
cd-downloads.ps1, Change the working directory to the user's downloads folder
|
||||
cd-dropbox.ps1, Change the working directory to the user's Dropbox folder
|
||||
cd-home.ps1, Change the working directory to the user's home folder
|
||||
cd-music.ps1, Change the working directory to the user's music folder
|
||||
cd-onedrive.ps1, Change the working directory to the user's OneDrive folder
|
||||
cd-pics.ps1, Change the working directory to the user's pictures folder
|
||||
cd-recycle-bin.ps1, Change the working directory to the user's recycle bin folder
|
||||
cd-repos.ps1, Change the working directory to the user's Git repositories folder
|
||||
cd-root.ps1, Change the working directory to the root directory (C: on Windows)
|
||||
cd-scripts.ps1, Change the working directory to the PowerShell Scripts folder
|
||||
cd-ssh.ps1, Change the working directory to the user's SSH folder
|
||||
cd-up.ps1, Change the working directory to one directory level up
|
||||
cd-up2.ps1, Change the working directory to two directory levels up
|
||||
cd-up3.ps1, Change the working directory to three directory levels up
|
||||
cd-up4.ps1, Change the working directory to four directory levels up
|
||||
cd-videos.ps1, Change the working directory to the user's videos folder
|
||||
cd-autostart.ps1, Set the working directory to the user's autostart folder
|
||||
cd-desktop.ps1, Set the working directory to the user's desktop folder
|
||||
cd-docs.ps1, Set the working directory to the user's documents folder
|
||||
cd-downloads.ps1, Set the working directory to the user's downloads folder
|
||||
cd-dropbox.ps1, Set the working directory to the user's Dropbox folder
|
||||
cd-home.ps1, Set the working directory to the user's home folder
|
||||
cd-music.ps1, Set the working directory to the user's music folder
|
||||
cd-onedrive.ps1, Set the working directory to the user's OneDrive folder
|
||||
cd-pics.ps1, Set the working directory to the user's pictures folder
|
||||
cd-recycle-bin.ps1, Set the working directory to the user's recycle bin folder
|
||||
cd-repos.ps1, Set the working directory to the user's Git repositories folder
|
||||
cd-root.ps1, Set the working directory to the root directory (C: on Windows)
|
||||
cd-scripts.ps1, Set the working directory to the PowerShell Scripts folder
|
||||
cd-ssh.ps1, Set the working directory to the user's SSH folder
|
||||
cd-up.ps1, Set the working directory to one directory level up
|
||||
cd-up2.ps1, Set the working directory to two directory levels up
|
||||
cd-up3.ps1, Set the working directory to three directory levels up
|
||||
cd-up4.ps1, Set the working directory to four directory levels up
|
||||
cd-videos.ps1, Set the working directory to the user's videos folder
|
||||
check-cpu-temp.ps1, Checks the CPU temperature
|
||||
check-dns-resolution.ps1, Checks the DNS resolution with frequently used domain names
|
||||
check-drive-space.ps1, Checks a drive for free space left
|
||||
|
|
27
Docs/cd-autostart.md
Normal file
27
Docs/cd-autostart.md
Normal file
@ -0,0 +1,27 @@
|
||||
## cd-autostart.ps1 - Sets the working directory to the user's autostart folder
|
||||
|
||||
This script changes the working directory to the user's autostart folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
cd-autostart.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./cd-autostart
|
||||
📂C:\Users\Markus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1*
|
@ -17,8 +17,8 @@ PS> ./list-console-colors
|
||||
|
||||
|
||||
|
||||
Name Foreground Background
|
||||
---- ---------- ----------
|
||||
Color As Foreground As Background
|
||||
----- ------------- -------------
|
||||
...
|
||||
|
||||
```
|
||||
|
35
README.md
35
README.md
@ -127,24 +127,25 @@ Mega Collection of PowerShell Scripts
|
||||
|
||||
| Script | Description | Help |
|
||||
| ---------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------- |
|
||||
| [cd-desktop.ps1](Scripts/cd-desktop.ps1) | Change the working directory to the user's desktop folder | [Help](Docs/cd-desktop.md) |
|
||||
| [cd-docs.ps1](Scripts/cd-docs.ps1) | Change the working directory to the user's documents folder | [Help](Docs/cd-docs.md) |
|
||||
| [cd-downloads.ps1](Scripts/cd-downloads.ps1) | Change the working directory to the user's downloads folder | [Help](Docs/cd-downloads.md) |
|
||||
| [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) | Change the working directory to the user's Dropbox folder | [Help](Docs/cd-dropbox.md) |
|
||||
| [cd-home.ps1](Scripts/cd-home.ps1) | Change the working directory to the user's home folder | [Help](Docs/cd-home.md) |
|
||||
| [cd-music.ps1](Scripts/cd-music.ps1) | Change the working directory to the user's music folder | [Help](Docs/cd-music.md) |
|
||||
| [cd-onedrive.ps1](Scripts/cd-onedrive.ps1) | Change the working directory to the user's OneDrive folder | [Help](Docs/cd-onedrive.md) |
|
||||
| [cd-pics.ps1](Scripts/cd-pics.ps1) | Change the working directory to the user's pictures folder | [Help](Docs/cd-pics.md) |
|
||||
| [cd-recycle-bin.ps1](Scripts/cd-recycle-bin.ps1) | Change the working directory to the user's recycle bin folder | [Help](Docs/cd-recycle-bin.md) |
|
||||
| [cd-autostart.ps1](Scripts/cd-autostart.ps1) | Set the working directory to the user's autostart folder | [Help](Docs/cd-autostart.md) |
|
||||
| [cd-desktop.ps1](Scripts/cd-desktop.ps1) | Set the working directory to the user's desktop folder | [Help](Docs/cd-desktop.md) |
|
||||
| [cd-docs.ps1](Scripts/cd-docs.ps1) | Set the working directory to the user's documents folder | [Help](Docs/cd-docs.md) |
|
||||
| [cd-downloads.ps1](Scripts/cd-downloads.ps1) | Set the working directory to the user's downloads folder | [Help](Docs/cd-downloads.md) |
|
||||
| [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) | Set the working directory to the user's Dropbox folder | [Help](Docs/cd-dropbox.md) |
|
||||
| [cd-home.ps1](Scripts/cd-home.ps1) | Set the working directory to the user's home folder | [Help](Docs/cd-home.md) |
|
||||
| [cd-music.ps1](Scripts/cd-music.ps1) | Set the working directory to the user's music folder | [Help](Docs/cd-music.md) |
|
||||
| [cd-onedrive.ps1](Scripts/cd-onedrive.ps1) | Set the working directory to the user's OneDrive folder | [Help](Docs/cd-onedrive.md) |
|
||||
| [cd-pics.ps1](Scripts/cd-pics.ps1) | Set the working directory to the user's pictures folder | [Help](Docs/cd-pics.md) |
|
||||
| [cd-recycle-bin.ps1](Scripts/cd-recycle-bin.ps1) | Set the working directory to the user's recycle bin folder | [Help](Docs/cd-recycle-bin.md) |
|
||||
| [cd-repos.ps1](Scripts/cd-repos.ps1) | Change the working directory to the user's Git repositories folder | [Help](Docs/cd-repos.md) |
|
||||
| [cd-root.ps1](Scripts/cd-root.ps1) | Change the working directory to the root directory (C:\ on Windows)| [Help](Docs/cd-root.md) |
|
||||
| [cd-scripts.ps1](Scripts/cd-scripts.ps1) | Change the working directory to the PowerShell Scripts folder | [Help](Docs/cd-scripts.md) |
|
||||
| [cd-ssh.ps1](Scripts/cd-ssh.ps1) | Change the working directory to the user's SSH folder | [Help](Docs/cd-ssh.md) |
|
||||
| [cd-up.ps1](Scripts/cd-up.ps1) | Change the working directory to one directory level up | [Help](Docs/cd-up.md) |
|
||||
| [cd-up2.ps1](Scripts/cd-up2.ps1) | Change the working directory to two directory levels up | [Help](Docs/cd-up2.md) |
|
||||
| [cd-up3.ps1](Scripts/cd-up3.ps1) | Change the working directory to three directory levels up | [Help](Docs/cd-up3.md) |
|
||||
| [cd-up4.ps1](Scripts/cd-up4.ps1) | Change the working directory to four directory levels up | [Help](Docs/cd-up4.md) |
|
||||
| [cd-videos.ps1](Scripts/cd-videos.ps1) | Change the working directory to the user's videos folder | [Help](Docs/cd-videos.md) |
|
||||
| [cd-root.ps1](Scripts/cd-root.ps1) | Set the working directory to the root directory (C:\ on Windows) | [Help](Docs/cd-root.md) |
|
||||
| [cd-scripts.ps1](Scripts/cd-scripts.ps1) | Set the working directory to the PowerShell Scripts folder | [Help](Docs/cd-scripts.md) |
|
||||
| [cd-ssh.ps1](Scripts/cd-ssh.ps1) | Set the working directory to the user's SSH folder | [Help](Docs/cd-ssh.md) |
|
||||
| [cd-up.ps1](Scripts/cd-up.ps1) | Set the working directory to one directory level up | [Help](Docs/cd-up.md) |
|
||||
| [cd-up2.ps1](Scripts/cd-up2.ps1) | Set the working directory to two directory levels up | [Help](Docs/cd-up2.md) |
|
||||
| [cd-up3.ps1](Scripts/cd-up3.ps1) | Set the working directory to three directory levels up | [Help](Docs/cd-up3.md) |
|
||||
| [cd-up4.ps1](Scripts/cd-up4.ps1) | Set the working directory to four directory levels up | [Help](Docs/cd-up4.md) |
|
||||
| [cd-videos.ps1](Scripts/cd-videos.ps1) | Set the working directory to the user's videos folder | [Help](Docs/cd-videos.md) |
|
||||
| [check-symlinks.ps1](Scripts/check-symlinks.ps1) | Checks every symlink in a directory tree | [Help](Docs/check-symlinks.md) |
|
||||
| [check-xml-file.ps1](Scripts/check-xml-file.ps1) | Checks the given XML file for validity | [Help](Docs/check-xml-file.md) |
|
||||
| [clear-recycle-bin.ps1](Scripts/clear-recycle-bin.ps1) | Removes the content of the recycle bin folder (can not be undo!) | [Help](Docs/clear-recycle-bin.md) |
|
||||
|
22
Scripts/cd-autostart.ps1
Executable file
22
Scripts/cd-autostart.ps1
Executable file
@ -0,0 +1,22 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the working directory to the user's autostart folder
|
||||
.DESCRIPTION
|
||||
This script changes the working directory to the user's autostart folder.
|
||||
.EXAMPLE
|
||||
PS> ./cd-autostart
|
||||
📂C:\Users\Markus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
#>
|
||||
|
||||
$TargetDir = resolve-path "$HOME/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Autostart"
|
||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
||||
write-warning "Sorry, the user's autostart folder at 📂$TargetDir does not exist (yet)"
|
||||
exit 1
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂$TargetDir"
|
||||
exit 0 # success
|
Loading…
Reference in New Issue
Block a user