Month: May 2025

Just another Tech site

Powershell run 5 batch file, create a log file, and verify folder location if not create folder

Below is a PowerShell script that will run five batch files, create a log file, and verify if a folder exists. If the folder does not exist, it will create the folder. # Define the folder path and log file path $folderPath = “C:\YourFolderPath” $logFilePath = “C:\YourFolderPath\log.txt” # Verify if the folder exists, if not,…
Read more

Powershell run 5 batch files, create a log file, and verify folder location

Recently was asked to run a series of batch files. Below is a PowerShell script that will run five batch files, create a log file for each execution, and verify the folder location before running the batch files. # Define the folder location and batch files $folderPath = “C:\Path\To\Your\BatchFiles” $batchFiles = @(“batch1.bat”, “batch2.bat”, “batch3.bat”, “batch4.bat”,…
Read more

PowerShell script function file download, unblock and install with multiple parameters and return installed version

Here’s a PowerShell script that defines a function to download a file, unblock it, install it, and return the installed version. The function accepts multiple parameters for flexibility. function Install-Software { param ( [Parameter(Mandatory = $true)] [string]$DownloadUrl, [Parameter(Mandatory = $true)] [string]$DestinationPath, [Parameter(Mandatory = $true)] [string]$InstallerArguments, [Parameter(Mandatory = $true)] [string]$VersionCommand ) try { # Step 1:…
Read more

PowerShell – BIOS Version

Looking to see what the current BIOS version is by running the following PowerShell script. This provides Manufacturer, version and the release date       $bios = Get-CimInstance -ClassName CIM_BIOSElement $bios | Select-Object Manufacturer, Version, ReleaseDate