Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:51
    vexx32 commented #15370
  • 10:42
    emilguden edited #15377
  • 10:40
    emilguden labeled #15377
  • 10:40
    emilguden opened #15377
  • 09:19
    NotNotWrongUsually commented #15370
  • 05:22

    daxian-dbw on master

    Update `Appx` manifest to newer… (compare)

  • 05:22
    daxian-dbw closed #15375
  • 05:22
    daxian-dbw closed #14957
  • 03:46
    jborean93 commented #15362
  • 02:36
    Artoria2e5 closed #13483
  • 02:36
    Artoria2e5 commented #13483
  • 01:19
    phillipsj edited #15376
  • 01:18
    phillipsj labeled #15376
  • 01:18
    phillipsj labeled #15376
  • 01:18
    phillipsj opened #15376
  • 00:45
    JAK1047 commented #11932
  • 00:38
    SteveL-MSFT edited #15375
  • 00:38
    SteveL-MSFT edited #15375
  • 00:38
    SteveL-MSFT edited #15375
  • 00:38
    SteveL-MSFT edited #15375
Celmor
@Celmor:matrix.org
[m]
has anyone been able to login on an sshd server (on windows) using the OpenSSHUtils (or is that module no longer needed)? According to the guide I need Repair-AuthorizedKeyPermission from that module but I can't install it
CodeUnstable
@CodeUnstable
@Aprazeth and @lacostya86, I am wanting to make a cross-platform CLI-Tool for compiling my WIP JVM language Cylvre (https://github.com/Cylvre-Language/Cylvre). As it is Java API, It could get a tad bit hard to make the tool.
S1m1B1lly
@S1m1B1lly
Is there a way to change the startup text, the copyrigt text or put my own text under it? like a figlet?
Celmor
@Celmor:matrix.org
[m]
@S1m1B1lly: powershell.exe -NoLogo hides it. you can print a custom message via commands in startup script (see $profile)
Ben Johnson
@cbj4074
image.png
Just received this randomly.
Don't recall updating anyting explicitly... maybe some Windows Update was installed on schedule or whatever, but that's super annoying. Things worked 8 hours ago, and now they're broken.
Installled version: N/A ... not helpful.
Ben Johnson
@cbj4074
I should add that upgrading to Powershell Core 7 doesn't help. I love many aspects of Powershell, but the lack of right hand talking to left hand is problematic.
Mochtar van de Griendt
@Aprazeth
@cbj4074 the fact that it can't detect which version is installed sounds, to me at least, as if there is something wrong with that script and not powershell. Have you tried checking it via $psversiontable ? If that reports PSVersion 7.x.x or 5.x.x (depending on which version you run it under of course) everything is working correctly on that end.
Mavaddat Javid
@mavaddat

hi PowerShellers, I was wondering about opening an issue on the PS repo to suggest that -ErrorAction allow for ScriptBlock data (system.management.automation.scriptblock). E.g., this one-liner to get a service and restart it with the catch action of setting the service startup type to manual in case of failure:

Get-Service *nord* | Restart-Service -Force -ErrorAction {$_ | Set-Service -StartupType manual; $_ | Restart-Service -Force}

Is this a bad idea (to make the issue to suggest this feature)? I am asking because the suggestion basically shortcuts the entire try-catch approach of C# and perhaps this is not even considerable.

Mochtar van de Griendt
@Aprazeth
@mavaddat Interesting point - and please note that this is my personal honest (and probably biased) opinion, but I'd suggest against it. The reasoning being that in PowerShell the general course is to filter first beforehand. In your example I'd wager that the reason you got the error from Restart-Service first is because some services were set tot disabled. The generally recommended recourse, and that's AFAIK in every language the case, is to check for any potential issues first, address those, and then take action. AKA Check twice, cut once. All of this said, it is a very interesting point you bring forward :)
Mavaddat Javid
@mavaddat
@Aprazeth I think you're right. I think the point of ErrorActionis not to provide the script that will occur in case of the error, but rather how the particular cmdlet itself will announce in case its produces an error. It's like the difference between a smoke alarm and a fire extinguisher. The latter is the tool that will be used in case of fire, but the former is how the fire itself is announced.
Kevin Crook
@kwcrook
Is Powershell EXO v2 really the only way to manage Exchange Online (other than the UI)?
I see people spinning up IIS + C# stacks to connect to it with Powershell... is there no API to add transport rules without using powershell cmdlets?
Mochtar van de Griendt
@Aprazeth
@kwcrook - you might get a better/more insightfull response with that question in the Exchange community, as the PowerShell community doesn't do anything per se with Exchange (as the Exchange team themselves are responsible for implementing their PowerShell APi and cmdlets) That said, speaking from my experience with SharePoint (yeay) I wouldn't be surprised if EOL was indeed using PSv2 still.
@kwcrook and a quick cursory search later: https://docs.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exo-v2-module - the module is version 2 not the required PowerShell version. It is officially supported on newer versions, and I quote "Specifically, version 2.0.4 or later of the EXO V2 module is supported in PowerShell 7.0.3 or later."
yuvaraj151089
@yuvaraj151089
Hi
Hello All,
I am working on. Powershell script to pull data from laptop.
1.Version of Adobe Connect and Zoom in device
2.When we intiate Adobe connect and Zoom Mic and camera drivers are initiated?
I am looking for a output to be displayed in page.
Help required is, how to display in page? I can create individual lines for each output but unable to get single display. Any help will be highly appreciated
Morgan Overman
@Smorgan05
I mean you could use wmi or pull from the install directory for Adobe Connect.
I'm gonna hazard a guess that you are doing this across an entierprise env
yuvaraj151089
@yuvaraj151089
yes, for larger environment
is there any wmi scripts available?
MikeR
@mikerossiter
I had a script to check version of Chrome across a large site on individual machines. Is that the kind of thing you mean?
yuvaraj151089
@yuvaraj151089
I want to send a link to user, and when user clicks the link, the script should be get user's Adobe connect and Zoom software version. Along with Mic and Camera of the Device is working or not. If user didn't have latest's version of software, there should be a update button which should get latest version of software from our software center.
Morgan Overman
@Smorgan05
@yuvaraj151089 That's called a group policy / SCCM. I would talk with your enterprise IT guys.
Mochtar van de Griendt
@Aprazeth
@yuvaraj151089 I'll second what @Smorgan05 is saying. In that case you'll want to use something along the lines of SCCM or other comparable products. You could do it with PowerShell but that is way way way more work initially and in the long term to support etc. compared to using something like SCCM
Morgan Overman
@Smorgan05
Also, here's the big problem with this across the enterprise the devices will vary. IT already knows what's on the network (domain) so that this can be deployed in a stable manner. Were I you I would tell them "hey I need the newest version of adobe connect and Zoom deployed across all devices on the network". If you tell them hey dog there's an MSI version they will love you. Also if you have an amazing enterprise IT dept they will be able to pull the event logs to ensure the Mic and Camera is working. The alternative is the scream test where the users check this by having a mandatory test meeting on zoom. (Takes my pretend IT hat off)
Morgan Overman
@Smorgan05
Also generally speaking install checking for Windows is terrible. Microsoft does not enforce standards and all the control panel is doing is pulling the program name, version number, and statically linking based on a static path in the registry. Also if you try to build a script by checking the program install folder won't work because the publisher may change means by which they deploy (appdata). This is the path of darkness.
Mochtar van de Griendt
@Aprazeth
Darkness being a nice way of saying insanity.
MikeR
@mikerossiter
In my experience you wouldn’t tell the end user to update (but I’m sure you have good reason to do that) but you would push the update out via group policy. The user would be none the wiser!
Morgan Overman
@Smorgan05
There are a few options but that's getting pedantic. shrugs
gravspeed
@gravspeed:matrix.org
[m]
so i'm trying to make a visual basic app using some powershell commands, but whenever i try to add the powershell package it tells me "Package 'PowerShell 7.1.3' has a package type 'DotnetTool' that is not supported by project 'ConsoleApp3'."
i suspect i'm doing something wrong....
what kind of projects are supported by "dotnettool" google is not being helpful
Morgan Overman
@Smorgan05
In general I do not recommend invoking powershell with C# there are native commands that one can use in C#.
Joel Sallow (/u/ta11ow)
@vexx32
You must be pulling in the wrong package from NuGet. The dotnet tool is only usable as a command line tool (dotnet tool install powershell) -- you'd want the SDK package, I think?
12annumishra17
@12annumishra17
Hey Team,
I've a powershell code which works fine with all the data execution. The issue comes when I leave a field blank in excel, it says you cannot call a null valued expression. Any help?
Jeremy
@JeremyTBradshaw
Howdy
Wondering if anyone has expertise with New-SelfSignedCertificate with PS 7.1+ and is open to chatting with me. Having an issue where $Cert = New-SelfSignedCertificate leads to $Cert.HasPrivateKey always being False.
I have tried with and without -KeyExportPolicy 'Exportable', seems it doesn't make a difference. Also tried from elevated and regular console.
Jeremy
@JeremyTBradshaw
I think I got it. Seems as though it is that the PKI module needs to be imported with -UseWindowsPowerShell, and then PKI cmdlets run from the WinPSCompatSession in order to get the private key behavior of 5.1 and earlier. Source: PowerShell/PowerShell#12081
Mochtar van de Griendt
@Aprazeth
Thanks for sharing @JeremyTBradshaw :)
Steve Azzopardi
@SteveAzz_gitlab

Hello folks! I'm trying to understand the behavior of $ErrorActionPreference when passing a script to pwsh via STDIN. Running echo "$ErrorActionPreference = 'Stop'; just bogus; Write-Host 'hello';" | pwsh -Command - doesn't really stop the execution, whilst having the same command and running it from a file it

File execution:

$ pwsh -Command  /tmp/exit.ps1
just: /tmp/exit.ps1:3
Line |
   3 |  just bogus;
     |  ~~~~
     | The term 'just' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

STDIN execution:

$ echo "$ErrorActionPreference = 'Stop'; just bogus; Write-Host 'hello';" | pwsh -Command -
=: The term '=' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
just: The term 'just' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
hello

$ echo $status
0

Is this expected behavior of ErrorActionPreference when being passed in STDIN?

2 replies
Christian Seidlitz
@SeidChr
Hey guys!
I just wanted to inform you, that we have a very active powershell discord comunity server.
If you have general questions about the language that may not require anyone who actively develops the language, you may get qick help there:
https://discord.gg/QNXdm2Qg
You are welcome!
Joel Sallow (/u/ta11ow)
@vexx32
@SeidChr are y'all not aware of https://aka.ms/psdiscord ? It's been the community PS discord for years.
Christian Seidlitz
@SeidChr
actually no :D
Joel Sallow (/u/ta11ow)
@vexx32
guess we gotta get better advertising :P anyway, y'all are welcome in that one too. I'm not against others springing up of course, just wanted to let ya know in case you weren't aware ^^
Christian Seidlitz
@SeidChr
i didnt know. already joined. you are still very welcome! :D
Morgan Overman
@Smorgan05
@SeidChr better advertising I just joined.
Mochtar van de Griendt
@Aprazeth
Ooooh, more places I can chase @Smorgan05 around - mwuahahahahaha. No but seriously, I am on both discords :)