Thanks first of all for reviewing this.
I've basically got a third-party agent software which allows me to execute PowerShell as LocalSystem. This allows me to easily run remote PowerShell commands without WinRM etc.
The problem that i'm running into is that on some servers i'm not able to perform get-WindowsFeature or Add-WindowsFeature.
An example of how i'm trying to achieve this is here:
Import-Module ServerManager;
Get-WindowsFeature;
The output is as such:
The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
If I type those same commands into a PowerShell window, or call PowerShell.exe directly, it returns. I'm trying to figure out what we're not doing right within the application, but i'm the most familiar person with PowerShell here.
Is there something special I need to do to load those cmdlets? Get-Module doesn't show anything, oddly.
Thank you!
In response to JBSmith:
Yessir - looks like 2.0. Here are the results of the commands you mentioned
>Name Value
>---- -----
>CLRVersion 2.0.50727.6407
>BuildVersion 6.1.7600.16385
>PSVersion 2.0
>WSManStackVersion 2.0
>PSCompatibleVersions {1.0, 2.0}
>SerializationVersion 1.1.0.1
>PSRemotingProtocolVersion 2.1
>
>Name : AppLocker
>Name : Appx
>Name : BestPractices
>Name : BitsTransfer
>Name : BranchCache
>Name : CimCmdlets
>Name : DirectAccessClientComponents
>Name : Dism
>Name : DnsClient
>Name : International
>Name : iSCSI
>Name : IscsiTarget
>Name : ISE
>Name : Kds
>Name : Microsoft.PowerShell.Diagnostics
>Name : Microsoft.PowerShell.Host
>Name : Microsoft.PowerShell.Management
>Name : Microsoft.PowerShell.Security
>Name : Microsoft.PowerShell.Utility
>Name : Microsoft.WSMan.Management
>Name : MMAgent
>Name : MsDtc
>Name : NetAdapter
>Name : NetConnection
>Name : NetLbfo
>Name : NetQos
>Name : NetSecurity
>Name : NetSwitchTeam
>Name : NetTCPIP
>Name : NetworkConnectivityStatus
>Name : NetworkTransition
>Name : MSFT_NfsMappedIdentity
>Name : NFS
>Name : PKI
>Name : PrintManagement
>Name : PSDiagnostics
>Name : PSScheduledJob
>Name : PSWorkflow
>Name : PSWorkflowUtility
>Name : RemoteDesktop
>Name : ScheduledTasks
>Name : SecureBoot
>Name : ServerCore
>Name : ServerManager
>Name : ServerManagerTasks
>Name : SmbShare
>Name : SmbWitness
>Name : Storage
>Name : TroubleshootingPack
>Name : TrustedPlatformModule
>Name : UserAccessLogging
>Name : VpnClient
>Name : Wdac
>Name : Whea
>Name : WindowsDeveloperLicense
>Name : WindowsErrorReporting
>Name : AWSPowerShell
I also noticed that GCM | ? { $_.ModuleName -eq 'ServerManager' } returns nothing when I run it through there, but through a normal PS window it returns a command list as expected.