Quickly and dirty determine if a condition is true or false in PowerShell 5.1 by emulating the ternary operator. For example when determinering if the server you are servicing is a Windows Server Desktop Experience version or not (and thus Server Core):
Code base for PowerShell scripting, PHP, ASP/VBScript, ASP.NET/C#, ASP.NET Core, Perl, code snippets and examples. Snippets are small pieces of reusable code.
how to remove phantom application folders from websites in IIS using PowerShell? Today I wanted to remove application folders from the website configuration in IIS whose physical path on the filesystem was removed. E.g when the application folder “/test1” in the website example.com should point to z:\sites\example.com\www\test1 but was removed. Here is now.
This might be specific to my Windows Server environment and PoSH scripting, but using -SeachBase with PowerShell’s Get-ADComputer gives me faster results. You can use this for your own advantage, here is a little example to speed up AD DS queries.
You can install Servicing Stack Updates (SSU) for Windows Server 2012R2, 2016 and Windows Server 2019 using PowerShell, without downtime. Because they must be installed prior to your normal Windows Server security updates, you can install them anytime you want to during the day. Here’s a small PowerShell example to do so.
Ever wondered why Windows Server Update Services (WSUS) offers Flash updates for Windows Server? Adobe Flash Player is installed on Windows Server 2016 / 2019 if you have the Remote Desktop Session Host (RDSH) role installed. Yikes! I can imagine you want to delete Adobe Flash Player without deleting the RDSH role, and here is how.
A connection string is sometimes a bit obscure. Do I need ODBC or OLE DB? When you need one and Google for it, you often find old ones that either don’t work at all anymore, or are not optimal. This article provides you with a couple of ASP.NET to SQL Server connection string examples, and …
Whenever you need to test your ASP.NET connection to your MySQL database, using ODBC, you can use the following C# test script. Currently it uses MySQL ODBC 8.0 Unicode Driver, but you can easily change the version used. As a bonus it prints some connection information and it requires an SSL connection to your MySQL …
Working with PowerShell’s Get-ItemProperty to get file attributes may boost your work productivity. It’s often easier to getting things done if you have a more generic way of doing something. Here is how to use Get-Item and Get-ItemProperty in PowerShell to perform and streamline day to day tasks like installing or updating software based on file versions. …
If you want to connect securely to your MySQL database over SSL using PHP Data Objects (PDO), here is how…
With PHP 7.1, some PHP web applications fail because of deprecated code usage. This may result in an error message like  operator not supported for strings for various Joomla, WordPress and Drupal components. Here’s how to fix this code for PHP 7.1+.
Unzipping a file on your PowerShell command line may come in handy sometimes, even on your Windows 10 workstation. Use Expand-Archive for this, and all that is required is PowerShell 5.0+, or the .NET 4.5+ Framework to use System.IO.Compression.ZipFile.
Compressed SQL Server backups can be verified in PowerShell using a handy PowerShell function. This comes in handy when you need to verify if existing SQL Server backups are compressed.
Detect the ethernet network speed using PowerShell or WMI is perfect for Windows Server Core. If you ever need to lookup the speed of your ethernet network card in Windows, on the command-line, use one of the following WMIC commands on your PowerShell prompt:
You sometimes need to list and get all MAC addresses of all Hyper-V virtual machines in your network. Either for your Hyper-V administration or provisioning if you don’t set an unique MAC address automatically. Here is how to get all those MAC addresses easily with PowerShell.
Here’s a blacklist check script written in PowerShell. You can use this to lookup an IP address in various blacklists (DNSBL, RBL). Such a check is a great indicator for an IP address’ reputation. Basically this PowerShell blacklist checker is a port of my Bash script to check an IP address blacklist status in Linux.