.net core
29 TopicsBuild PowerShell as "framework-dependent"
Before I start a time expensive and maybe unsuccessful attempt: Is it relatively easily possible to compile PowerShell from the source and make it "framework-dependent" instead of "self-contained"? In doing so, PowerShell could be de-coupled from the .NET runtime (which is most probably already installed), and maybe an even newer runtime version could be used (currently, PowerShell has no .NET 10 packed and I have to wait for a release that supports it)...53Views0likes1CommentHow to find out the type of a generic class?
Exmple: create a new List<string> instance: $a = [System.Collections.Generic.List[string]]::new() With: $a.GetType() I only get: IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True List`1 System.Object How can I tell what type the list is (in my case, string)?Solved148Views0likes2Commentspositioning a set of powershell windows
Greetings, I'm completely new to this area. I have a requirement to display 3 separate powershell windows that are created from nodejs on my server, in essentially this format, ------- ---------------------------- | 1 | | 2 | ------- ----------------------------- ------------------------------------- | 3 | -------------------------------------- is the monitoring server app is the adminController app is the mainServerHub for all client connections to main app. is started manually on the server and automatically positions itself on the screen is created by the monitoring server app (1) and should be positioned on the right of screen 1 is also created by the monitoring server app (1) and should be positioned under both 1 and 2 I have searched many descriptions and links to resolve this challenge. I'm successful in creating all of the powershell windows from nodejs, but it has quite a challenge trying to manipulate their positions, and I'm looking for the appropriate cmdlets to accomplish this task. Can anyone point me in the right direction? Thanks Scott.210Views0likes1CommentWhich of Get-AppxPackage's "Remove-AppxPackage" and winget.exe's "uninstall" is preferable?
Without regard for the specified software that is designed for removal, how do the undermentioned: winget uninstall --id 'Microsoft.Windows.Photos_8wekyb3d8bbwe' -e ...and the undermentioned: Get-AppxPackage -AllUsers *Microsoft.Xbox* | Remove-AppxPackage ...differ?5.2KViews0likes3Commentsshadowcopy
I see when I type wmic /? it shows me wmi options for shadowcopy. Thats great if using the deprecated WMI tool. Leads me to, so I can pull shadowcopy information using WMI tool, what about PS? When I search for shadowcopy with powershell, I find nothing. If there is some shadowcopy hooks in powershell what are they? And can we make them easier to find? seaching all PS docs using below comes up with nothing! Import-Module (Microsoft.PowerShell.Core) - PowerShell | Microsoft Learn\ Thanks! Rod820Views0likes2CommentsSet exchange policy with filter?
I am trying to figure out how to run a command to create a exchange online emailadresspolicy. New-EmailAddressPolicy -Name Groups1 -IncludeUnifiedGroupRecipients -EnabledEmailAddressTemplates "SMTP:@santa.mycompany.com","smtp:@santa.mycompany.com" -RecipientFilter {mailNickname -like 'Santa_*'} -Priority 1 I want all groups that are that have a mailnickname that starts with "Santa_" to be created with a specific subdomain. I can not create it tho, i get error that recipientFilter is not a valid attribute. New-EmailAddressPolicy: A parameter cannot be found that matches parameter name 'RecipientFilter'. i have also tried ConditionalCustomAttribute1 but get the same error: anyone able to help?586Views0likes5CommentsError - Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException
Error Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Remote name could not be resolved: 'server.proxy.local'960Views0likes1CommentHow to Execute Disable-NetAdapter from Constrained Runspace?
Please, I need help ASAP!!! What .NET Class maps to Disbale-NetAdapter Commandlet? E.g., the .NET Class, GetDateCommand is an Implementation of the get-date commandlet. ----------------------------------------------------------------------------------------------------------------- var getDateCommand = new SessionStateCmdletEntry("get-date", typeof(GetDateCommand), null); powerShellSession.Commands.Add(getDateCommand); ----------------------------------------------------------------------------------------------------------------- I need to know the Class to use for Disbale-NetAdapter, please. That is what type am I to use777Views0likes3CommentsHow to change remote session prompt?
For my 7.4.1 Powershell, I have a custom prompt stored in $PROFILE\profile.ps1 (that's the only profile file that exists on my machine). This works well until I start a remote session using Enter-PSSession, where I get a default prompt. How can I apply my custom prompt to remote sessions as well?543Views0likes3Comments