While working on some projects in my home lab recently, I’ve begun encountering resource shortages. Many of these shortages stem from my original intention to utilize repurposed desktop hardware. Although my lab no longer uses VMware, I still utilize it for work and read content, such as William Lam’s blog . While browsing his VCF9 content, I began to notice some relatively inexpensive machines that would meet my needs by providing more CPU and RAM for my workloads. The Minisforum MS-A2 immediately came to consideration due to its 16-core/32-thread AMD processor and the ability to support up to 96GB of RAM. However, shipping is relatively delayed, and I don’t need the smallest form factor available. Further research led me to the Minisforum 795S7 , which has similar specifications but in a larger case. The 795S7 fits exactly what I was looking for in a lab machine. The processor and RAM mentioned above enable me to reduce the required number of hosts f...
A few weeks ago, I wrote a post about using PowerShell for logging script outputs and mentioned there’d be a part two. So here we go, finally. PowerShell logging is great for keeping track of data, but log files can quickly get too big. This makes it hard to find what you need or manage storage. With a simple script, you can split logs into separate files when needed. $logPath = "c:\Scripts\NICPingCheck.log" #Check if old log files exist and delete them if (Test-Path "$logPath.old") { Remove-Item "$logPath.old" -Force Write-Host "Old log file removed." } else { Write-Host "No old log file found to remove." } #Rename the current log file to .old if (Test-Path $logPath) { Rename-Item -Path $logPath -NewName "$logPath.old" -Force Write-Host "Current log file renamed to .old." } The script starts by deleting any files ending in .old. Next, it renames the current log file to add .old, so you al...
PowerShell is one of the most powerful tools in an administrator's toolbox, and I use it daily. The more I do with PowerShell, the more I need to record my script and save my script output as reference or proof of the changes made. For example, when did that condition-based automation fire, and what did it do, or what data did you update from that data extract from HR against AD? PowerShell provides several options, and here are my favorites. Write-Host The simplest option is the "Write-Host" command, which returns the output to the command window. This is great for returning simple values; you can watch as the script runs. By including the variable after the write host command, you can print its value at that point in the code for reference- $timestamp = (Get-Date).ToString("yyyy-MM-dd HH:mm:ss") $message = "Logging Blog" Write-Host "$timestamp - $message" Typically, this wouldn't record the output anywhere other than i...
Comments
Post a Comment