Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 04 18:15
    fatherofinvention commented #1075
  • Feb 04 18:14
    fatherofinvention commented #1075
  • Feb 04 18:13
    fatherofinvention commented #1075
  • Feb 04 18:12
    fatherofinvention closed #1075
  • Feb 04 18:12
    fatherofinvention commented #1075
  • Feb 03 19:51

    Badgerati on develop

    fix for choco packer (compare)

  • Feb 02 21:58

    Badgerati on gh-pages

    v2.8.0 docs (compare)

  • Feb 02 21:38

    Badgerati on v2.8.0

    (compare)

  • Feb 02 21:30

    Badgerati on master

    add workflows for auto-assignin… Merge pull request #1027 from B… helps if you add the action ver… and 71 more (compare)

  • Feb 02 21:30
    Badgerati closed #1076
  • Feb 02 20:56
    Badgerati commented #1007
  • Feb 01 21:21
    Badgerati synchronize #1076
  • Feb 01 21:21

    Badgerati on develop

    minor tweak to release notes (compare)

  • Feb 01 21:14
    Badgerati milestoned #1076
  • Feb 01 21:14
    Badgerati labeled #1076
  • Feb 01 21:14
    Badgerati milestoned #1076
  • Feb 01 21:14
    Badgerati assigned #1076
  • Feb 01 21:14
    Badgerati opened #1076
  • Feb 01 21:12

    Badgerati on develop

    add v2.8.0 release notes (compare)

  • Feb 01 21:02
    Badgerati labeled #1067
Craig Dayton
@cadayton
Ended up just using Start-Process run server.ps1. Not as clean but it works.
Matthew Kelly
@Badgerati

Hey @cadayton, that should be about all that's needed. Few questions though, is $scriptPath a relative or literal path? In the docs I used -Command instead of -File - any difference there if you change it?

On the last line you've got nssm status <name> is that a typo here and meant to be nssm start <name>?

Failing all of that, there's a change an error could be being thrown, so wrapping the whole server.ps1 in a try/catch could give some hints; something like:

try {
    Start-PodeServer, etc, etc
}
catch {
    $_.Exception.Message | Out-File C:/temp/pode_errors.txt
}
Craig Dayton
@cadayton
Thanks Matthew. It is just the literal path as seen as 'Executing' in the last screen shot. 'nssm status' is intentiional this logic is just installing the service and the service gets started when the Tor service is started. I'll try the -Command option and the try/catch combo too. Thanks again.
Craig Dayton
@cadayton
The catch statement is outputting the following. Very first statement in the server.ps1 script is Import-Module Pode -Global. So stumped as to why it is not being found.
The term 'Start-PodeServer' 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.
PJ
@panekj:matrix.org
[m]
you could add #Require -Modules Pode
but you could check where the Pode is installed
if it's in user scope, it might not work :>
get-module Pode -All -ListAvailable
Craig Dayton
@cadayton
Thanks!! @panekj:matrix.org . I installed module with a scope of 'currentuser'. So I think you've figured it out, so makes sense why the local system account can't find it.
PJ
@panekj:matrix.org
[m]
yup
PJ
@panekj:matrix.org
[m]
huh, thought it was easier to find out in which scope the module is, seems like looking up paths is the only way
Craig Dayton
@cadayton
Just confirming that re-installing the Pode and Pode.Web module with a scope of AllUsers has resolved my issue of not being able to run it as a Windows service.
PS>nssm start PodeWebFull
PodeWebFull: START: The operation completed successfully.
Thanks all for your second pair of eyes.
Craig Dayton
@cadayton
Now that I have a better understanding of tor and V3 Onion Services, I can get back to doing more Pode experimentation.
Samuel Gagnon
@samuelleb11
Can someone help me understand why I get this after using Reset-PodeWebPage in a Modal ?
Date: 2021-10-12 16:16:01
at Invoke-PodeScriptBlock, C:\Users\sgagnon\Documents\PowerShell\Modules\Pode\2.4.2\Public\Utilities.ps1: line 662
at <ScriptBlock>, <No file>: line 107

Date: 2021-10-12 16:16:01
Level: Error
ThreadId: 3
Server: WH-DESK04
Category: System.Private.CoreLib
Message: Collection was modified; enumeration operation may not execute.
StackTrace:    at System.Collections.Hashtable.HashtableEnumerator.MoveNext()
   at System.Management.Automation.EnumerableOps.FlattenResults(Object o, List`1 result)
   at System.Management.Automation.EnumerableOps.PropertyGetterWorker(CallSite`1 getMemberBinderSite, IEnumerator enumerator, ExecutionContext context, List`1 result)
   at System.Management.Automation.EnumerableOps.PropertyGetter(PSGetMemberBinder binder, IEnumerator enumerator)
   at Get-PodeRoute(Closure , FunctionContext )
Samuel Gagnon
@samuelleb11
And, is there a way of passing more then one argument to Modals ?
Matthew Kelly
@Badgerati
Oooo, that's interesting! I'll test reset-page in a modal when I get chance, because that shouldn't be happening; especially in Get-PodeRoute as well 🤔
By arguments, do you mean -ArgumentList, or something else?
Samuel Gagnon
@samuelleb11
Yes, now the only option I have is -DataValue
My solution is to merge objects properties that I need into one object and the convert it to JSON. Then in the modal ScriptBlock section I do a ConvertFrom-Json
Samuel Gagnon
@samuelleb11
Also, it seems that using custom modules cmdlets in a modal's ScriptBlock tends to block it. I then use Invoke-Command and pipe it into Out-Null to fix the issue.
Matthew Kelly
@Badgerati
the -ArgumentList is an object[], so you shouldbe able to do something like the following 🤔
New-PodeWebModal -ArgumentList $obj1, $obj2, $obj3 -ScriptBlock {
    param($obj1, $obj2, $obj3)
}
They shouldn't block, what's the cmdlet doing?
Samuel Gagnon
@samuelleb11
But then how do I pass the object from a foreach while building the page ?
Matthew Kelly
@Badgerati
Have you got a script example of what you're trying to achieve?
Holger Voges
@hvoges
I´ve got a problem with creating Tabs from an array. I read the configuration from a csv-file and create a list of WebTabs from it. But Pode.web is creating only one tab. Something I have missed or misunderstood here? This is the code-Snippet:
    $RoomList = Import-Csv -Path D:\Deployment\Rooms.csv -Delimiter ";" -Encoding UTF8
    $Tabs = @( Foreach ( $Room in $RoomList )
    {
        New-PodeWebTab -Name $Room.Name -Icon $Room.Icon -Layouts @(
            New-PodeWebCard -Content @(
                New-PodeWebText -Value 'Here is some Normal text.'
            )
        )

    } )

    Add-PodeWebPage -Name 'Rooms' -Icon google-classroom -ArgumentList $Tabs -ScriptBlock {
        param ($Tabs)
        New-PodeWebTabs -Tabs @($Tabs)
    }
Matthew Kelly
@Badgerati
Hi @hvoges, it'll be because -ArgumentList takes an array of objects and is then splatted onto the scriptblock. To keep the current way -ArgumentList @(,$Tabs) should do the trick, or use a hashtable instead: -ArgumentList @{ Tabs = $Tabs }
Veers01
@Veers01
Hi! I have a question about implementing AzureAD auth with Pode and Pode.web. I have a multipage site and I want to have define access control by page, not sitewide. If I use Active Directory auth, I can use the -AccessGroup or -AccessUser in add-PodeWebPage cmdlet. Is there anything equivalent for AAD? Thank you!
Matthew Kelly
@Badgerati
Hey @Veers01, it should be possible to use -AccessUsers with AAD, though you might need to set -UsernameProperty on Set-PodeWebLoginPage to either "preferred_username" or "email" to force a username property, rather than just use Pode.Web's default. For groups, it breaks a little bit there at the moment. The access_token I think should be a JWT and contains claims like the groups, but will need parsing - in the next version of Pode its ConvertFrom-PodeJwt should hopefully be moved to public :)
Veers01
@Veers01
@Badgerati Thank you, I'll try that!
Holger Voges
@hvoges
Hi @badgerati, thank you! Another Question: I want to use the chosen Value of a select-Element as an Input for another Element (Codeditor). Is there any way to preserver a value outside of a scriptblock?
New-PodeWebSelect -Name Job -Options "One","Two","Three"
In this special case I want to use the Chosen Value for an input for the Codeditior, but as there is currently no update-PodeWebCodeEditor, I cannot edit the Element inside the PodeWebSelect-Scriptblock.
2 replies
Miodrag Milić
@majkinetor
Hi @Badgerati , long time no see. I was thinking of creating web cron via Pode, like task scheduler on Windows just via web. So i am interested in the following : di you try to stress test scheduler ? Will it be able to run lets say 100 jobs, or job every second without losing executions, skipping them etc. I am currently using Rundeck but since they got new owners it started to suck a lot so I need alternative
image.png
As an example, here is what I want to recreated
this is a rundeck project that executes 8 powershell jobs, all are scheduled and organized into folders based on environment name. Bellow you see individual executions of jobs
each job has its properties and its own execution
image.png
and you can see CLI logs. And that it.
I tested several years ago its quartz scheduler and it was awesome.... executing thousands of jobs per day without any problem.
Do you think pode could menage something like that ?
Matthew Kelly
@Badgerati

Hey @majkinetor :D, the lowest Pode's can go down to is a minute using cron; I've never stress tested it to extreme limits but I do have a health probe running on numerous web servers which runs a minutely schedule and it's not suffered any; plus another, which is a timer, that runs every 20secs, which does the bulk of CPU/IIS/Service checks, and also running fine. The most schedules I've seen was in a Pingdom-esque site someone built, which was running like 10-20 minutely schedules without issue.

As Pode triggers schedules, they're run in their own runspace, in a pool which allows up to a max of 10 to run at the same time (we could allow this to be customised), and then queues them if the pool is full. If you did have a schedule run every minute, and one of the times it triggered it did happen to run for 2mins, then Pode would trigger the schedule another 2 times during the running one.

I've been thinking about building a scheduler like this as well in Pode, so will be interesting to see how schedules/timers perform under load 🤔

Robin Beismann
@RobinBeismann
Hey @majkinetor, we're using Jenkins for this purpose, I finally managed to onboard all jobs that have previously been running on task schedulers on various servers within the the last 2 years, now we're at 80 jobs in Jenkins and it works out great for us.
It takes a bit to get used to, especially the credential handling, but it was defo worth the effort.
Since Jenkins works a lot with Nodes, you can have the nodes as close as possible to the application you're automating. Let's say, you're automating stuff on SCCM, have a Jenkins Node on the SCCM Server and it can even use the servers local identity.
I've looked into Rundeck before too, but it has a cost so I looked into Jenkins instead.
Miodrag Milić
@majkinetor
@Badgerati thx a lot. Minute is fine, if something needs to run more then that it should be service, not a job.
@RobinBeismann Jenkins was first on my mind as Rundeck replacement. However, its just overkill
and its not designed for that purpose in mind
I am running all the shell scripts on server node . They either run locally or do remote session
FYI, Rundeck is free, enterprise is payed since year or two
i am using it like 10+ years for free
Rundeck is really great for this purpose, its just that new corporate overlords (pager duty) don't have the same goals as previous ones and that they have mega serious bug that they ignore (when job timeouts on Rundeck it keeps shell process running without killing it so they pile up)