If you'd like to find out whether an instance of WinWord (or any other program) is currently running, you can try this: (Get-Process winword -ea...
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 WindowsPowerShellFinding Files
Dir (Get-Childitem) is a simple, but effective way to find files. The following line will find any file or folder called "hosts" anywhere...
Opening Results in Excel
To send PowerShell results to Excel, you can use CSV-files and automate the entire process by using this function: function...
Creating Self-Updatable Variables
If you want a variable to update its content every time you retrieve it, you can assign a breakpoint and an action to it. The action script block...
Open File Exclusively
To open a file in a locked state so no one else can open, access, read, or write the file, you can use the low-level .NET methods like this: $path =...
Simple Breakpoint
If you want PowerShell to halt your script at some point, you can simply add this line: $host.EnterNestedPrompt() This will suspend execution and...
Locking the Computer
To lock your computer from PowerShell, remember that you can launch applications, including rundll32.exe, which can be used to call methods from...
Extract Text without Regular Expressions
If you don't like creating Regular Expression patterns, here is a trick so you can easily find and extract text: $text = 'The problem was...
Use RegEx to Extract Text
With Regular Expressions, you can easily extract matching text. Have a look: $text = 'The problem was discussed in KB552356. Mail feedback to...
Use Select-String with Context
Select-String can find lines with a specific keyword. It can also include context-relevant lines before and after that line. This will filter the...
Launching Applications
When you launch *.exe-applications with arguments, you may get exceptions because PowerShell may misinterpret the arguments. A better way to do this...
Managing File System Tasks
If you need to list all cmdlets that deal with file system-related tasks, try this: Get-Command -Noun item*, path Many of these cmdlets have...
Appending CSV Data
To append a CSV file with new data, first of all make sure the type of data you append is the same type of data already in a file (or else column...
Create CSV without Header
ConvertTo-CSV can create comma separated values (CSV) on the fly but it always adds a new header. To create CSV data without columns, take a look at...
Checking Array Content With Wildcards
In a previous tip we illustrated how -like can work on array. To iterate on that, check out how -like (in contrast to -contains) allows the use of...
Assigning Two Unique Random Numbers
If you need to get two random numbers from a given numeric range, and you want to make sure they cannot be the same, simply tell Get-Random to pick...
Eliminating Empty Text
If you wanted to exclude results with empty (text) columns, you can filter based on $null values. This will get you all processes with a valid...
Adding Personal Drives
In a previous tip we showed you how you can add new drives to easily access your desktop, your cookies or media like music and video. However, when...
When to use Select-Object’s -ExpandProperty
Use Select-Object to determine which information in a result you are interested in. Here are three easy rules for its parameters: Use -Property *...
Combining Network Adapter Information
In a previous tip you learned that WMI network adapter information is separated into two classes. Win32_NetworkAdapter represents the hardware, and...
Getting Network Adapter Settings
To view the configuration details of a network adapter, you can specify the network adapter connection ID as it appears in your control panel. ...
Enumerating Network Cards
In a previous tip you learned how to use a shortcut to quickly open the dialog with your network adapters. Today, you get a piece of code to access...
Shortcut to Network Cards
To quickly access the settings for your network cards, use this line from within PowerShell: explorer.exe...
Find Local Group Members
If you'd like to list all members of local groups, encapsulate net.exe and make it a PowerShell function: function Get-LocalGroupMember{ param(...
Find Local Groups
On Windows 7, net.exe can list all local groups. To use this information with PowerShell, try this simple wrapper: function Get-LocalGroup { net...
Find Local Users
On Windows 7, the easiest way to find local user accounts is to use net.exe. Here is a simple PowerShell wrapper called Get-LocalUser: function...
Escape Regular Expressions
PowerShell supports regular expressions in a lot of areas which is why the following code fails: 'c:\test\subfolder\file' -split '\'...
Monitor Open Files
In a previous tip we introduced the command openfiles which lists and disconnects files that were opened remotely on your machine. Openfiles can...
Finding Open Files
If you'd like to see which files are opened by network users on your machine, there is an internal command for it. All you need are local admin...
Removing File Extensions (Safe)
In a previous tip we showed that Trim() is an unsafe way for removing file extensions. A safe way uses .NET methods:...