Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:11:14+00:00 2026-06-01T16:11:14+00:00

I was told to write multiple actions using powershell script. Actions such as Apppool

  • 0

I was told to write multiple actions using powershell script. Actions such as Apppool creation, SQL updation, File editing and etc.

I am going to write such a bulk thing in script first time.

So i would like to know the best practice before writting them.

Is it a good practice to write all the function in a single file?

I am thinking at least 10 functions i may need to write. Assuming each function may have 10 lines of code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:11:16+00:00Added an answer on June 1, 2026 at 4:11 pm

    Consider modules: the simplest format is a manifest (.psd1) and a single script file (.psm1) containing all the functions, aliases, … the module exports (plus any internal helpers).

    In this case you are clearly putting multiple connected functions in one file. Even if much of the code is only dot-sourced into the script module they are still logically in one entity.

    On the other hand using scripts in your path to execute without having to load before hand would tend (as per Adriano’s comment to the question) to support one function (at script scope rather than a function statement) makes sense.

    Therefore: there is no one “good practice”: it all depends on the details of the circumstance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i tried to write a daemon under linux using C, i was told
Can anyone told me how to write this regex for No multiple hyphens or
In my team I've been told to write resource class like this style: class
I'm trying to write a program in Python and I'm told to run an
I was recently told that using mongodb _id fields in a URL is unsafe.
I'm using a fprintf function to print to a new file I'm using the
i was told to write program which generate unique 5 digit number ( for
I'm told that document.write should be avoided in web page since it hurts web
I made an object in Interface Builder. Then I told it to write the
A colleague of mine recently stated it is fine for multiple read write threads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.