In PowerShell v3, to work with WMI you can still use the old WMI cmdlets like Get-WmiObject. There is a new set of CIM cmdlets, though, that pretty...
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 Keyboard and Mouse
You can use WMI to quickly find all details about your mouse and keyboard: PS> Get-WmiObject win32_PointingDevice | Where-Object { $_.Description...
Finding Built-In Variables Part 2
In a previous tip we featured a piece of undocumented code that works in PowerShell v3 to list all built-in variables. Here is another approach that...
Adjust Text to Specific Length
If you must make sure that a text has a fixed length and is neither shorter nor longer, here is the code to pad and cut the text to the desired...
Finding Built-In Variables
Finding Built-In Variables...
Displaying MsgBox TopMost
In a previous tip you learned how to load additional .NET assemblies. This enables you to display dialog boxes like a MsgBox, pretty much like in...
Loading Additional Assemblies
When you want to load additional .NET assemblies to extend the types of object you can use, there are two ways of loading them: the direct .NET...
Using Open File Dialogs
To spice up your scripts, PowerShell can use the system open file dialog, so users could easily select files to open or to parse. Here's the...
Playing WAV files
PowerShell can play WAV files, so you can add sound and special effects to your scripts (provided your system has a sound card): PS> $player =...
Adding New Type Accelerators
To access popular .NET types faster, PowerShell maintains a list of shortcuts called "type accelerators". That's why you can use the...
Discovering Date and Time Culture Information
PowerShell automatically converts date and time information in various formats. If you'd like to know what formats are recognized by PowerShell,...
Installing Local Printer
WMI represents all locally installed printers with its class Win32_Printer, so you can easily look what's installed: PS> Get-WmiObject -Class...
Parsing Custom Date and Time Formats
Sometimes, date and time information is not formatted according to the standards PowerShell understands by default. When this happens, you can...
Discovering Network Access
PowerShell can access low-level COM interfaces to find out system information such as network access. This code returns a list of all active network...
Finding Constructors (and submitting Credentials unattended)
When you need to log on with alternate credentials, cmdlets often pop up a login dialog, like here: $cred = Get-Credential If you wanted to run a...
Checking Network Adapter Speed
Sometimes, just one line of PowerShell code gets you all the information you may have needed. There is a .NET type called NetworkInterface, for...
Finding WMI Class Static Methods
In a previous tip, we illustrated how to use Invoke-WmiMethod to create a network share locally and remotely. Today, you dive a bit deeper and find...
Converting Date from French to Taiwanese
Date and Time formats are highly culture-specific, so often you need to convert date and time from one cultural format to another. That's pretty...
Create File Shares Remotely
To create a new file share remotely, you could use the WMI class Win32_Share and its Create() method. Invoke-WmiMethod helps you run WMI methods...
Displaying WMI Inheritance
In PowerShell 3.0, the (hidden) object property PSTypeNames shows you the complete inheritance tree for WMI objects: PS> $os = Get-WmiObject...
Auto-Discovering Online Help for WMI
Get-WmiObject is a great and simple cmdlet to retrieve WMI information, and the parameter -List returns all available WMI class names that you can...
Using MemberSets
In a previous tip you learned how PropertySets can create groups of properties for easier access. Yet another (hidden) feature of PowerShell objects...
Using PropertySets
PropertySets are lists of properties, and PowerShell sometimes adds PropertySets to result objects to make picking the right information easier....
Getting Weather Forecast from an Airfield near You
PowerShell can access web services and automatically retrieve information such as weather forecasts. New-WebServiceProxy does all the work for you,...
Checking System Uptime
In a previous tip we explained how you read date and time information from WMI and convert it into a regular date and time information. With this...
Converting Date to WMI Date
WMI (Windows Management Instrumentation, Get-WmiObject) uses a specific (DTMF) format for date and time. You can easily convert regular date and...
Accessing PowerShell Host Process
With this line, you always get back the process object representing the current PowerShell host: PS>...
Using Specific Error Handlers
If you want error handler to handle specific error types, you can add the error type after the keyword trap or catch. However, this will only work...
Finding Popular Historic First Names
To find popular first names for given decades, check out the function Get-PopularName. It accepts a decade between 1880 and 2000 and then uses the...
Why Using Here-Strings?
To create multi-line text in a script, you can simply enter the multi-line text into your script using quotes: $text = 'First Line Second Line...