In the previous tip we explained how you can use Select-String and a regular expression to extract valuable information from raw text results: PS...
posts-powershell
Categories
- Free tools
- SQL Admin Toolset
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Doctor
- SQL Enterprise Job Manager
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Tags
Administration agent-based monitoring Agentless Monitoring alert responses alert thresholds alerting Alerts Amazon Aurora Amazon EC2 Amazon RDS Amazon RDS / Aurora Amazon RDS for SQL Server Amazon Redshift Amazon S3 Amazon Web Services (AWS) Analytics application monitoring Aqua Data Studio automation availability Azure Azure SQL Database azure sql managed instance Azure VM backup Backup and recovery backup and restore backup compression backup status Backup Strategy backups big data Blocking bug fixes business architecture business data objects business intelligence business process modeling business process models capacity planning change management cloud cloud database cloud database monitoring cloud infrastructure cloud migration cloud providers Cloud Readiness Cloud Services cloud storage cloud virtual machine cloud VM clusters code completion collaboration compliance compliance audit compliance audits compliance manager compliance reporting conference configuration connect to database cpu Cross Platform custom counters Custom Views customer survey customer testimonials Dark Theme dashboards data analysis Data Analytics data architect data architecture data breaches Data Collector data governance data lakes data lineage data management data model data modeler data modeling data models data privacy data protection data security data security measures data sources data visualization data warehouse database database administration database administrator database automation database backup database backups database capacity database changes database community database connection database design database developer database developers database development database diversity Database Engine Tuning Advisor database fragmentation database GUI database IDE database indexes database inventory management database locks database management database migration database monitoring database navigation database optimization database performance Database Permissions database platforms database profiling database queries database recovery database replication database restore database schema database security database support database synchronization database tools database transactions database tuning database-as-a-service databases DB Change Manager DB Optimizer DB PowerStudio DB2 DBA DBaaS DBArtisan dBase DBMS DDL Debugging defragmentation Demo diagnostic manager diagnostics dimensional modeling disaster recovery Download drills embedded database Encryption End-user Experience entity-relationship model ER/Studio ER/Studio Data Architect ER/Studio Enterprise Team Edition events execution plans free tools galera cluster GDPR Getting Started Git GitHub Google Cloud Hadoop Healthcare high availability HIPAA Hive hybrid clouds Hyper-V IDERA IDERA ACE Index Analyzer index optimization infrastructure as a service (IaaS) infrastructure monitoring installation Integrated Development Environment interbase Inventory Manager IT infrastructure Java JD Edwards JSON licensing load test load testing logical data model macOS macros managed cloud database managed cloud databases MariaDB memory memorystorage memoryusage metadata metric baselines metric thresholds Microsoft Azure Microsoft Azure SQL Database Microsoft PowerShell Microsoft SQL Server Microsoft Windows MongoDB monitoring Monitoring Tools Monyog multiple platforms MySQL news newsletter NoSQL Notifications odbc optimization Oracle PeopleSoft performance Performance Dashboards performance metrics performance monitoring performance schema performance tuning personally identifiable information physical data model Platform platform as a service (PaaS) PostgreSQL Precise Precise for Databases Precise for Oracle Precise for SQL Server Precise Management Database (PMDB) product updates Project Migration public clouds Query Analyzer query builder query monitor query optimization query performance Query Store query tool query tuning query-level waits Rapid SQL rdbms real time monitoring Real User Monitoring recovery regulations relational databases Releases Reporting Reports repository Restore reverse engineering Roadmap sample SAP Scalability Security Policy Security Practices server monitoring Server performance server-level waits Service Level Agreement SkySQL slow query SNMP snowflake source control SQL SQL Admin Toolset SQL CM SQL code SQL coding SQL Compliance Manager SQL Defrag Manager sql development SQL Diagnostic Manager SQL Diagnostic Manager for MySQL SQL Diagnostic Manager for SQL Server SQL Diagnostic Manager Pro SQL DM SQL Doctor SQL Enterprise Job Manager SQl IM SQL Inventory Manager SQL Management Suite SQL Monitoring SQL Performance SQL Quality SQL query SQL Query Tuner SQL Safe Backup SQL script SQL Secure SQL Security Suite SQL Server sql server alert SQL Server Migration SQL Server Performance SQL Server Recommendations SQL Server Security SQL statement history SQL tuning SQL Virtual Database sqlmemory sqlserver SQLyog Storage Storage Performance structured data Subversion Support tempdb tempdb data temporal data Tips and Tricks troubleshooting universal data models universal mapping unstructured data Uptime Infrastructure Monitor user experience user permissions Virtual Machine (VM) web services webinar What-if analysis WindowsPowerShellParsing Raw Text (Part 1)
Sometimes, you may want to extract valuable information from pure text results. One easy way is the use of Select-String. This example extracts only...
Adjusting Simple UIs
In the previous tip you learned how you can use Show-Command to create simple UIs for text-based commands: #requires -Version 3.0 function...
Creating Simple UIs
Function and cmdlet parameters basically are the technique how PowerShell creates „user interfaces“. These text-based interfaces can...
Extending Robocopy
PowerShell can add value to existing commands such as robocopy. Take a look at the below function--it uses robocopy to copy files, and adds the...
Copy Color-Coded Code
When you select code in the PowerShell ISE and copy it to the clipboard, it is copied in RTF format and preserves all color coding and font...
Creating WinForms GUIs in PowerShell
While it is recommended to use the modern WPF technology to create PowerShell user interfaces, you might still want to occasionally use the older...
Using “Exit” to Communicate with Linux
When a PowerShell script ends, you can run the command “Exit” and submit a numeric value. This has been good practice in the Windows...
Capturing Linux Output
If you run PowerShell on Linux, you can combine Linux and PowerShell commands. To take the output of a Linux command and assign it to a PowerShell...
Test for File or Folder
Test-Path can check whether a file or folder exists. If you add -PathType and specify Leaf (for files) or Container (for folders), the result can be...
System Memory, Units, and Rounding
Sometimes, you’d like to use different units of measurements. The total system memory is reported in bytes, for example. Here are some...
Creating Time Spans
You can use New-TimeSpan to define “amounts” of time, and then add or subtract them from dates. Here is an example: $1Day = New-TimeSpan...
Waiting for Processes to Exit
Sometimes, a PowerShell script needs to wait for external processes to finish. Here is what some users do: $processNameToWaitForExit =...
Using PowerShell Remoting with PIN-enabled Accounts
If you have set up a PIN to log into your computer, PowerShell remoting against your own machine may fail with a weird error message: PS C:\>...
Separating Results by Property Value
If you use PowerShell remoting to receive information from remote machines, you can use fan-out simply by specifying more than one computer name....
Analyzing Result Frequencies (without Wasting Memory)
Use Group-Object to group objects based on shared property values, but don’t forget to use –NoElement parameter to discard the actual objects and...
Finding Unapproved Verbs
Cmdlets and functions should use only approved verbs to make it easier on user to find commands, and improve consistency. Here is quick audit code...
Most Popular Verbs
Safely Encrypting and Decrypting Text
When you encrypt secret information, the challenge is to find a good secret. One particular safe secret would be your Windows identity, paired with...
Watch Out When Combining -Force and -WhatIf!
The -WhatIf common parameter turns on simulation mode, so a cmdlet won’t change anything and instead report what it “would have”...
Creating File Shares
In Server 2012 R2 and Windows 8.1, there are many useful new modules with cmdlets such as New-SmbShare which creates new file shares easily. If you...
Using Custom Scopes to Discard Any Output
Yesterday we looked at custom scopes to automatically restore variables and clean up behind your code. Custom scopes can also be used to discard any...
Using Custom Scopes
When you change variables, you might need to clean up later and ensure that you reverted them back to some default value – unless you use...
Catching Errors from Native EXEs
Ever wondered how you can catch errors emitted by native console EXEs? PowerShell’s error handlers can only deal with .NET code. Here is the...
Advanced Error Handling: Rethrowing Exceptions
When you handle errors, you may sometimes want to replace the original exception with your own. Here is a sample: function Do-Something { # function...
Launching Applications as Someone Else
Let’s assume you would like to open multiple PowerShell consoles running under different identities – or launch whatever application you...
Shed Light into the PowerShell Version Jungle
Meanwhile, there are five major versions of PowerShell around. Toss in the new minor versions such as PowerShell 5.1 on Windows 10 and Server 2016....
Fixing PowerShell 5 Help Bug
When you download PowerShell help via Update-Help, there was a bug in PowerShell 5 that might be fixed by now: text-based help files had the...
Prohibiting Positional Parameters
When you create PowerShell functions, parameters can be named or positional. Here is an example: If you’d like to detect illegal characters in...
Using Named Parameters in PowerShell Functions
When you create a PowerShell function, all parameters are positional until you start adding the “Position” attribute. Once you start to...