Windows 10: Powershell script, custom module call crashing session

Discus and support Powershell script, custom module call crashing session in Windows 10 Software and Apps to solve the problem; Hey,Currently running into an issue with a custom PowerShell script that I own.The script has been in production almost daily for the past 4-5 years... Discussion in 'Windows 10 Software and Apps' started by KatoBaade, Jun 12, 2024.

  1. KatoBaade Win User

    Powershell script, custom module call crashing session


    Hey,Currently running into an issue with a custom PowerShell script that I own.The script has been in production almost daily for the past 4-5 years but the past couple weeks it's been erroring out on me for reasons I don't understand. The script in question is an AD mgmt script which checks 800+ users and updates, deactivates and creates users based on a master data file which is imported from our payroll system.The script crashes, along with the PS session every time when the script hits a specific point, which is running a custom module that runs through and deactivates a list of AD users t

    :)
     
    KatoBaade, Jun 12, 2024
    #1
  2. EckiS Win User

    PowerShell script run - Cmdlets

    As SQL-IP and Cosmos are still internal to Microsoft, I wonder why you are not simply contacting the person who provided you with the scripts.

    For point 1: see PowerShell: Bypass ExecutionPolicy to run downloaded scripts

    For point2: this is specific to the script: "Cosmos.Document" is probably in a module which is not found.
     
    EckiS, Jun 12, 2024
    #2
  3. PowerShell scripts not working with Call operator

    Hi,



    Thank you for writing to Microsoft Community Forums.



    I understand that you are facing issues while developing a PowerShell script using the Call operator. I would suggest you to refer the articles

    The Windows PowerShell ISE
    .



    However, as the issue is related to developing PowerShell scripts, I would suggest you to post your query on

    MSDN forums
    , where we have expertise and developers who are well equipped with the knowledge of developing PowerShell scripts in Windows.



    Regards,

    Prakhar Khare

    Microsoft Community – Moderator
     
    Prakhar_Khare, Jun 12, 2024
    #3
  4. Powershell script, custom module call crashing session

    Powershell Scripts in the Windows 10 OS and script execution policy of "Allow only Signed scripts"

    We have the group policy " Turn on Script execution" enabled and set to "Allow only Signed scripts".

    Will this affect the powershell scripts used in the Windows 10 operating System or does windows have something inbuilt that overrides the settings we apply. I'm thinking that it would block even the W10 built in scripts.

    An example of what I am talking about are the 246 .ps1 files in the various diagnostic directories in c:\windows\diagnostics\system\ . our diags never come back with issues even when deliberately disabling components before running.

    other areas that Powershell scripts live that I have found with a quick search -

    C:\Windows\WinSxS\wow64_microsoft.powershell.odatautils_31bf3856ad364e35_10.0.17763.1_none_d60dcab1d9234fab

    C:\Program Files (x86)\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Diagnostics\Comprehensive

    C:\Program Files\WindowsPowerShell\Modules - various folders in here.

    Do we need to sign all powershell scripts that come with the OS?

    Does Microsoft have a method of doing this?

    Is there a list of script files that come with the OS so we don't just do a sign all approach, then find we have signed malware files.

    we could probably configure something in the build task sequence to sign what is there initially. Is there any plan in place for Microsoft to start signing their scripts?

    Will this be an ongoing process as updates are applied and files replaced, do we need to have a process in place to sign all PS1 files in the OS?
     
    Paul Klerkx(psk), Jun 12, 2024
    #4
Thema:

Powershell script, custom module call crashing session

Loading...
  1. Powershell script, custom module call crashing session - Similar Threads - Powershell script custom

  2. PowerShell script help

    in Windows 10 Software and Apps
    PowerShell script help: Hello,I am trying to use PowerShell to edit similar file names examples below. no_25!2-2_FORSE_COMP.prnno_25!2-4_FORSE_COMP.prnno_25!2-9_FORSE_COMP.prnno_30!10-5_FORSE_COMP.prngb_10!01-_5_FORSE_COMP.prnno_30!11-3_FORSE_COMP.prnI need all the writing in upper case, the '!'...
  3. Powershell script, custom module call crashing session

    in Windows 10 Gaming
    Powershell script, custom module call crashing session: Hey,Currently running into an issue with a custom PowerShell script that I own.The script has been in production almost daily for the past 4-5 years but the past couple weeks it's been erroring out on me for reasons I don't understand. The script in question is an AD mgmt...
  4. PowerShell script

    in Windows 10 Support
    PowerShell script: The code below tests a series of IPs in a txt file.The result is as follows and is written in a txt file. 19.191.12.161 - online 19.191.12.162 - offline 19.191.12.163 - offline 19.191.12.164 - offline 19.191.12.165 - offline also see the scrennshot Code: $Output= @()$GetIP =...
  5. powershell scripts

    in AntiVirus, Firewalls and System Security
    powershell scripts: Hi, I have azure. Someone is somehow installing powershell scripts onto my computer that allows them to host my PC through P2P and UDP connections, well I think so anyway. I have only just found powershell script entry changes in my registry by accident. These criminals...
  6. powershell script

    in Windows 10 Customization
    powershell script: looking for a script to monitor for a folder, if there is a file in that folder send it as an email, once the email is sent out, confirm and then move the files to an archive folder. monitor c:\test\*.pdf No files, do not send email. Yes Files, send an email to someone at...
  7. Powershell Script on Shutdown

    in Windows 10 Performance & Maintenance
    Powershell Script on Shutdown: Hi all, I try to run a Powershell Script (*.ps1) when i shut down my PC. I created the script and it is working fine when i run it. However if i want to run it on a regular Shutdown it seems like it does not start or is not finished, before Windows is killing every running...
  8. PowerShell scripts not working with Call operator

    in Windows 10 BSOD Crashes and Debugging
    PowerShell scripts not working with Call operator: Hello I have been developing a Powershell script using Powershell ISE, and for the most part i am very happy about it, however i have encountered what i believe to be a bug in the call operator (&). When i use the call operator followed by a "pure" string everything works...
  9. A Powershell Script for HandBrake

    in Windows 10 Software and Apps
    A Powershell Script for HandBrake: Here's the thing. My system is an age-old i3-530 overclocked to 3.5GHz coupled with GTX 1050 2GB. I have around 1.5TB of tutorial videos that I have to encode due to dearth in HDD space. I want to encode the videos while keeping the folder and subfolder structure intact....
  10. PowerShell Scripting - The Basics

    in Windows 10 Tutorials
    PowerShell Scripting - The Basics: How to: PowerShell Scripting - The Basics [img] Information A PowerShell script is a collection of commands and cmdlets to be run in logical order, previous lines in script determining values and variables in command lines thereafter. The principle is the same than in...