|
1 | 1 | # Powershell-Useful-Scripts ⭐ |
2 | | -Repository of small scripts that can be used for specific tasks such as obtaining hardware information among others. |
3 | | - |
4 | | - |
5 | | -## List and explanation |
6 | | - |
7 | | -- ### Add-SvManager.ps1 |
8 | | - Add servers to Server Manager, specifying the name. |
9 | | - In addition to this, format the XML document before adding the server and save the changes for successful results. |
10 | | - |
11 | | -- ### BackupFiles.ps1 |
12 | | - Creates a backup of important installers from one location to another, creating a backup copy. |
13 | | - |
14 | | -- ### Clean-Temp.ps1.ps1 |
15 | | - Clean temporary files from assigned folders. |
16 | | - |
17 | | -- ### Convert-Image-To-PDF.ps1 |
18 | | - Converts .bmp, .jpg, .jpeg, .png, .gif, .tiff, .ico file to a .pdf file, file selection functionality with interaction box. |
19 | | - |
20 | | -- ### Convert-VHDX-To-Qcow2.ps1 |
21 | | - Converts .vhdx file to a .qcow2 file, file selection functionality with interaction box. |
22 | | - |
23 | | -- ### Convert-Docx-To-PDF.ps1 |
24 | | - Exports .docx file to a .pdf file, file selection functionality with interaction box. |
25 | | - |
26 | | - - **Requeriments** |
27 | | - - Word Application |
28 | | - |
29 | | -- ### Convert-PDF-To-Docx.ps1 |
30 | | - Exports .pdf file to a .docx file, file selection functionality with interaction box. |
31 | | - |
32 | | - - **Requeriments** |
33 | | - - Word Application |
34 | | - |
35 | | -- ### Decrypt-Password.ps1 |
36 | | - Decrypts password stored in ".\Password.txt" and outputs the password result in clear text. |
37 | | - |
38 | | -- ### Defrag-Disk.ps1 |
39 | | - Defragment all disks installed on the computer. |
40 | | - |
41 | | -- ### Disable-Firewall.ps1 |
42 | | - Disable the 3 different profiles of the Firewall. |
43 | | - |
44 | | -- ### Encrypt-Password.ps1 |
45 | | - Encrypts password passed through an input and saves it encrypted in a ".\Password.txt" file. |
46 | | - |
47 | | -- ### Enable-Firewall.ps1 |
48 | | - Enable the 3 different profiles of the Firewall. |
49 | | - |
50 | | -- ### Format-XML.ps1 |
51 | | - Formats an XML document to make it easier to view. |
52 | | - With file selection function using the file explorer. |
53 | | - |
54 | | -- ### Get-ActiveUsersReport.ps1 |
55 | | - Save a report of active users into a "ActiveUsersReport.txt" file. |
56 | | - |
57 | | -- ### Get-UserCommits.ps1 |
58 | | - Function to obtain the commits that a user has made on GitHub in a given time, this function uses the following parameters: |
59 | | - |
60 | | - - **Username:** Username to be reviewed |
61 | | - - **Token:** Github API Token to use |
62 | | - - **DaysBack:** Days ago do you want to review the commits |
63 | | - |
64 | | -- ### Get-HW.ps1 |
65 | | - Useful command to discover the hardware that the specific computer is using. |
66 | | - It distributes and organizes all the information so that it is visually clear. |
67 | | - |
68 | | -- ### Get-CPU-Temp.ps1 |
69 | | - Print CPU temperature in Celsius on terminal. |
70 | | - |
71 | | -- ### Get-HighResourcesProcess.ps1 |
72 | | - Prints the 10 processes with the most CPU consumption in an orderly manner. |
73 | | - |
74 | | -- ### Get-Disk-Temp.ps1 |
75 | | - Print Disks temperature in Celsius on terminal. |
76 | | - |
77 | | -- ### Get-SvManager.ps1 |
78 | | - Obtains and sorts the servers added to the Server Manager. |
79 | | - So that they can be clearly displayed and information can be obtained from them such as the Status and the Date of the last update. |
80 | | - |
81 | | -- ### Get-SoftwareUpdates.ps1 |
82 | | - This script checks for and installs pending software updates on the system. |
83 | | - |
84 | | -- ### Get-VolumeInfo.ps1 |
85 | | - Allows you to list and select volumes to review the main characteristics in an organized and visually clear manner. |
86 | | - |
87 | | -- ### Get-WeatherReport.ps1 |
88 | | - Get a weather report for the country/city you want through a web request. |
89 | | - |
90 | | -- ### Get-IPReport.ps1 |
91 | | - Generates a detailed report of the current device's IP information including public IP, private IP, subnet mask, address family, and MAC address. |
92 | | - Provides a clear, color-coded display of all relevant network information. |
93 | | - |
94 | | - - Information: |
95 | | - - Public IP Address |
96 | | - - Hostname Public IP |
97 | | - - City of Public IP |
98 | | - - Organization of Public IP |
99 | | - - Postal Code of Public IP |
100 | | - - Tiemzones of Public IP |
101 | | - - Privates IP Addresses |
102 | | - - Submasks of Private IPs |
103 | | - - Addresses Family Private IPs |
104 | | - - MAC Addresses |
105 | | - |
106 | | -- ### Monitor-Website.ps1 |
107 | | - Monitor a specific web url with customizable interval seconds giving details about date and time. |
108 | | - |
109 | | - - Example: |
110 | | - |
111 | | -  |
112 | | - |
113 | | -- ### Optimize-Register.ps1 |
114 | | - Clean the Windows Registry for proper operation of the system and its components. |
115 | | - |
116 | | -- ### Remove-Secure.ps1 |
117 | | - Deletes the selected file so that it is untraceable once cleaned by file recovery software. |
118 | | - |
119 | | -- ### Set-ColorTheme.ps1 |
120 | | - Change the color of the Windows theme between light and dark with the option to decide between either of the two. |
121 | | - |
122 | | -- ### Sincronize-NTP.ps1 |
123 | | - Function to synchronize the NTP server of your system, with the following parameters: |
124 | | - |
125 | | - - **Wait:** Time to wait to execute NTP server synchronization (In seconds) |
126 | | - - **Confirm:** Ask to confirm before executing the command |
127 | | - |
128 | | -- ### Test-Latency.ps1 |
129 | | - Generates a report of the current device latency by setting six targets which are Google, Cloudflare, OpenDNS, Verizon DNS, AWS and Microsoft Azure. |
130 | | - Provides latency, an indication of the state of latency, visual and error control. |
131 | | - |
132 | | - - Example: |
133 | | - |
134 | | -  |
135 | | - |
136 | | -- ### Update-MSEdge.ps1 |
137 | | - Forces Microsoft Edge browser to update to the latest available version of the program. |
138 | | - |
139 | | -- ### UltraCompress-File.ps1 |
140 | | - Compresses the entered file to a .zip with the highest compression allowed in powershell. |
141 | | - |
142 | | -- ### Verify-SystemFiles.ps1 |
143 | | - Check and repair system files using the sfc /scannow command. The script provides detailed output on the status of the system file check and determines whether any issues were found and could not be repaired automatically. |
144 | | - |
145 | | - |
146 | | -## How to use |
147 | | -1. Run Powershell |
| 2 | +Repository of small scripts that can be used for specific tasks such as Networking, automation, file conversion, server administration and more. |
| 3 | + |
| 4 | +## Main objectives |
| 5 | +The main goal of the project is to create a well-organized repository with tools that empower and help both system administrators and PowerShell developers. I also value continuous learning and knowledge sharing, so I would appreciate any feedback or ideas that would support the project. |
| 6 | + |
| 7 | +## Available Scripts |
| 8 | + |
| 9 | +### Server Administration |
| 10 | +- **Add-SvManager.ps1**: Adds servers to Server Manager, formats the XML document before adding the server, and saves the changes. |
| 11 | +- **Get-SvManager.ps1**: Retrieves and organizes the servers added to Server Manager, displaying information such as status and the date of the last update. |
| 12 | + |
| 13 | +### Backup and Cleanup |
| 14 | +- **BackupFiles.ps1**: Creates a backup of important installers from one location to another. |
| 15 | +- **Clean-Temp.ps1**: Cleans temporary files from assigned folders. |
| 16 | +- **Optimize-Register.ps1**: Cleans the Windows Registry for proper system and component operation. |
| 17 | +- **Remove-Secure.ps1**: Deletes a file so that it is untraceable by file recovery software. |
| 18 | + |
| 19 | +### File Conversion |
| 20 | +- **Convert-Image-To-PDF.ps1**: Converts image files (.bmp, .jpg, .jpeg, .png, .gif, .tiff, .ico) to PDF files. |
| 21 | +- **Convert-VHDX-To-Qcow2.ps1**: Converts .vhdx files to .qcow2 files. |
| 22 | +- **Convert-Docx-To-PDF.ps1**: Exports .docx files to PDF files. |
| 23 | + - **Requirements**: Word Application. |
| 24 | +- **Convert-PDF-To-Docx.ps1**: Exports PDF files to .docx files. |
| 25 | + - **Requirements**: Word Application. |
| 26 | + |
| 27 | +### Security and Passwords |
| 28 | +- **Decrypt-Password.ps1**: Decrypts a password stored in ".\Password.txt" and outputs the result in clear text. |
| 29 | +- **Encrypt-Password.ps1**: Encrypts a password provided through input and saves it encrypted in a ".\Password.txt" file. |
| 30 | + |
| 31 | +### System Information |
| 32 | +- **Get-ActiveUsersReport.ps1**: Saves a report of active users into an "ActiveUsersReport.txt" file. |
| 33 | +- **Get-HW.ps1**: Discovers and organizes information about the hardware of the specific computer. |
| 34 | +- **Get-CPU-Temp.ps1**: Prints the CPU temperature in Celsius on the terminal. |
| 35 | +- **Get-Disk-Temp.ps1**: Prints the disk temperatures in Celsius on the terminal. |
| 36 | +- **Get-HighResourcesProcess.ps1**: Prints the top 10 processes with the highest CPU consumption in an orderly manner. |
| 37 | +- **Get-VolumeInfo.ps1**: Lists and selects volumes to review their main characteristics in an organized and clear manner. |
| 38 | +- **Verify-SystemFiles.ps1**: Checks and repairs system files using the `sfc /scannow` command. |
| 39 | + |
| 40 | +### Network and Connectivity |
| 41 | +- **Get-IPReport.ps1**: Generates a detailed report of the current device's IP information, including public IP, private IP, subnet mask, address family, and MAC address. |
| 42 | +- **Monitor-Website.ps1**: Monitors a specific web URL with a customizable interval, providing details about the date and time. |
| 43 | +- **Test-Latency.ps1**: Generates a report of the current device latency by setting six targets (Google, Cloudflare, OpenDNS, Verizon DNS, AWS, Microsoft Azure). |
| 44 | + |
| 45 | +### Updates and Synchronization |
| 46 | +- **Get-SoftwareUpdates.ps1**: Checks for and installs pending software updates on the system. |
| 47 | +- **Sincronize-NTP.ps1**: Synchronizes the system's NTP server with the following parameters: |
| 48 | + - **Wait**: Time to wait before executing the NTP server synchronization (in seconds). |
| 49 | + - **Confirm**: Ask for confirmation before executing the command. |
| 50 | +- **Update-MSEdge.ps1**: Forces Microsoft Edge to update to the latest available version. |
| 51 | + |
| 52 | +### Compression and Formatting |
| 53 | +- **UltraCompress-File.ps1**: Compresses the specified file to a .zip with the highest compression allowed in PowerShell. |
| 54 | +- **Format-XML.ps1**: Formats an XML document to make it easier to view, with file selection functionality using the file explorer. |
| 55 | + |
| 56 | +## How to Use |
| 57 | + |
| 58 | +1. Run PowerShell. |
148 | 59 |
|
149 | | - |
| 60 | +  |
150 | 61 |
|
151 | | -2. Locate the path where the scripts you want to run are located |
| 62 | +3. Locate the path where the scripts you want to run are located. |
152 | 63 |
|
153 | | - |
| 64 | +  |
154 | 65 |
|
155 | | -3. Run the script you want to use |
| 66 | +5. Run the script you want to use. |
156 | 67 |
|
157 | | -**Example:** |
158 | | - ```powershell |
159 | | -.\Scripts\Test-Latency.ps1 |
160 | | -```` |
| 68 | + **Example:** |
| 69 | + ```powershell |
| 70 | + .\Scripts\Test-Latency.ps1 |
| 71 | + ``` |
161 | 72 |
|
162 | 73 | ## Contributing |
163 | 74 | Contributions to enhance the repository or address issues are welcome. Please open a GitHub issue or submit a pull request. |
|
0 commit comments