简体   繁体   English

有没有一种方法可以在目录中自动执行PowerShell?

[英]Is there a way to have a PowerShell be executed automatically within a directory?

I have a situation and am hoping there is an easy way to get around it. 我有一个情况,希望有一个简单的方法来解决它。

I have a folder, and inside this folder, there are 12 other sub-folders. 我有一个文件夹,并且在此文件夹中,还有其他12个子文件夹。 Inside each of these sub-folders, there is PS script and 2 files being compared in the script. 在每个子文件夹中,都有PS脚本和正在比较的2个文件。 The 2 files are called using parameters in the script. 使用脚本中的参数调用这两个文件。

Is there a way to have all of the scripts run automatically? 有没有办法让所有脚本自动运行? I'm assuming it would have to be another script that can then iterate through the subfolders? 我假设它必须是另一个脚本,然后可以遍历子文件夹?

If anymore information is needed or any other suggestions can be made, please let me know! 如果需要更多信息或可以提出任何其他建议,请告诉我! Thanks in advance for any help. 在此先感谢您的帮助。

If I get you correctly, you need to parts of codes: 如果我正确理解了您,则需要输入部分代码:

  1. Get-childitem -recursive , filter ps1 Get-childitem -recursive,过滤器ps1
  2. Foreach script , invoke-command. Foreach脚本,invoke-command。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在要执行的PowerShell脚本中提供凭据 - Afford credentials within a PowerShell script to be executed 您如何获得 powershell 以列出目录中文件夹的权限,同时忽略具有访问权限的组? - How can you get a powershell to list the permissions of folders within a directory while ignoring groups that have access? 使用powershell,有没有办法在目录中搜索已应用指定组权限的文件和文件夹? - Using powershell, is there a way to search a directory for files and folders which have a specified group permission applied? 有没有办法从字符串中执行命令或在 powershell 电子邮件中有多个正文? - Is there a way to execute a command from within a string or have more than one body in a powershell email? 如何让powershell显示当前目录 - How to have powershell display the current directory Powershell-检查目录是否为空的正确方法 - Powershell - Correct Way of Checking if a directory is empty 与Powershell相比,做远程目录的最佳方法 - Best way to do a remote directory compare with Powershell 自动创建目录 Azure Data Lake Gen 2 - PowerShell - Creation of Directory Azure Data Lake Gen 2 Automatically - PowerShell Powershell 查询活动目录并自动生成未使用的计算机名 - Powershell Query Active Directory and automatically generate an unused computer name 有没有办法遍历Powershell中的publicsuffix列表? - Is there a way to loop through the publicsuffix list within Powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM