Powershell Core Can't Execute Cmdlet that Powershell Can

Abstract: Resolve PowerShell Core command not found errors for Windows-specific modules by switching to PowerShell 5.1 or using cross-platform alternatives.

Created: 2026-09-10 by

PowerShell Core cannot execute certain cmdlets because it is a cross-platform implementation that excludes Windows-specific modules like ActiveDirectory, DnsClient, and NetTCPIP. These legacy components rely on .NET Framework APIs unavailable in the cross-platform .NET runtime. To resolve this, you must either use PowerShell 5.1 for Windows-only tasks or find cross-platform alternatives compatible with PowerShell Core.

The Fundamental Difference Between Editions

The confusion often arises from assuming that "PowerShell" and "PowerShell Core" are interchangeable terms for the same engine. They are not. The version of PowerShell pre-installed on Windows (versions 3 through 5.1) is built on the .NET Framework. This older runtime includes deep integration with Windows operating system components, allowing it to load modules that interact directly with Windows internals, such as registry management, WMI, and specific network configurations. PowerShell Core (versions 6.0 and later, now unified under PowerShell 7+) is built on .NET Core (and subsequently .NET 5/6/7+). It is designed to be cross-platform, running on Linux, macOS, and Windows. Because it aims for portability, it deliberately strips out dependencies that are exclusive to Windows. Consequently, any cmdlet that requires Windows-specific .NET Framework assemblies will fail to load in PowerShell Core. When you attempt to run a cmdlet like Get-ADUser or Resolve-DnsName in PowerShell Core, the engine looks for the module but finds no compatible binary, resulting in a "command not found" error. This distinction is critical for administrators who manage hybrid environments. Scripts written for PowerShell 5.1 may break unexpectedly when executed in a containerized Linux environment or on a Mac using PowerShell Core. Understanding this architectural split prevents wasted time debugging syntax errors that are actually compatibility issues.

Identifying Windows-Specific Cmdlets

Not all cmdlets are available in PowerShell Core. The most common offenders include:
  • Active Directory Module: Cmdlets like New-ADUser, Get-ADGroup, and Set-ADAccountPassword require the Active Directory Web Services API, which is strictly Windows-based.
  • DNS Management: Cmdlets such as Resolve-DnsName and Add-DnsServerPrimaryZone depend on Windows DNS client libraries.
  • Network Configuration: Cmdlets like Get-NetIPConfiguration and New-NetIPAddress interface with Windows Network Adapter settings via WMI/CIM providers that do not exist on Linux or macOS.
  • Registry Access: While basic file operations work, the Registry: drive provider relies on Windows Registry APIs.
To verify if a cmdlet is available in your current session, you can use the Get-Command cmdlet. If you type Get-Command -Name Resolve-DnsName in PowerShell Core and receive no output, the command is definitively not supported in that environment. In contrast, PowerShell 5.1 will return the full object details for the cmdlet.

Solutions for Cross-Platform Compatibility

If you need to run scripts across different operating systems, you must refactor your code to avoid Windows-specific cmdlets. There are three primary strategies to overcome this limitation. 1. Use Native OS Commands or Aliases Many Windows-specific tasks have equivalents in standard POSIX commands or native tools. For example, instead of using Resolve-DnsName, you can use the nslookup or dig commands if installed. For IP configuration, you might use ipconfig on Windows or ifconfig/ip addr on Linux/macOS. You can detect the operating system within PowerShell using $PSVersionTable.OS and branch your logic accordingly. 2. Leverage Third-Party Modules The community has developed cross-platform modules that replicate functionality. For instance, while the official Active Directory module is Windows-only, there are open-source implementations like DSInternals (with limitations) or LDAP-based approaches using standard .NET classes. For DNS, you can use .NET's System.Net.Dns class directly, which works across all platforms. ```powershell

Cross-platform DNS resolution using .NET

[System.Net.Dns]::GetHostAddresses("example.com") ``` This approach bypasses the need for a specific PowerShell module entirely, relying on the underlying .NET runtime which is consistent across versions. 3. Run PowerShell 5.1 on Windows If your workflow is strictly Windows-based and requires legacy cmdlets, continue using the Windows PowerShell host (powershell.exe) rather than PowerShell Core (pwsh.exe). You can invoke PowerShell 5.1 explicitly from PowerShell Core if necessary, though this introduces overhead. For daily administration on Windows servers, sticking to PowerShell 5.1 remains the most stable path for AD and DHCP management. For more context on how command-line behaviors differ between shells, see our guide on Command Prompt Drive Switching Different From PowerShell.

Managing Module Availability

You can inspect which modules are available in your current PowerShell Core installation by running Get-Module -ListAvailable. You will notice a significantly smaller list compared to PowerShell 5.1. Microsoft provides a curated list of cross-platform modules on the PowerShell Gallery. Searching for modules with the tag "CrossPlatform" or checking their documentation for supported operating systems is essential before adoption. Additionally, consider using Import-Module with the -ErrorAction SilentlyContinue parameter if you are writing portable scripts that might run on both engines. This prevents the script from terminating if a non-critical Windows module fails to load. See also: Run Powershell command from cmd with parameters for related shell interoperability issues.

Frequently Asked Questions

Can I install Windows modules into PowerShell Core?

No, you cannot install Windows-specific modules like Active Directory into PowerShell Core because they rely on .NET Framework binaries that do not exist in the cross-platform runtime. You must use PowerShell 5.1 on Windows to access these features.

Why does Get-Module show fewer results in PowerShell Core?

PowerShell Core excludes modules that depend on Windows-only technologies such as WMI, COM objects, and the Windows Registry provider. This reduction ensures the engine remains lightweight and portable across Linux and macOS.

How do I check my PowerShell version programmatically?

You can check the version by examining the $PSVersionTable automatic variable. The PSEdition property will display "Desktop" for PowerShell 5.1 and "Core" for PowerShell 7+, helping you debug compatibility issues.

Are there alternatives to Resolve-DnsName in PowerShell Core?

Yes, you can use the [System.Net.Dns] static class in .NET to perform DNS lookups. This method is fully cross-platform and does not require any additional modules or Windows-specific cmdlets.

Is PowerShell 5.1 deprecated?

PowerShell 5.1 is not deprecated but is no longer receiving feature updates. It remains supported for security fixes on Windows 10 and Server 2016/2019/2022. However, new development should target PowerShell 7+ for cross-platform capabilities.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More