首页 > 其他分享 >统计集团飞书软件安装情况

统计集团飞书软件安装情况

时间:2023-05-10 16:45:23浏览次数:51  
标签:English Version file Path 软件 path 安装 reg 统计

点击查看代码
#样例
#文件路径
#C:\HEMS English Version\app\HEMS English Version.exe
#C:\Users\e03424\AppData\Local\HEMS English Version\app\HEMS English Version.exe
#注册表路径:
#计算机\HKEY_USERS\S-1-5-21-3354446880-2111472190-2361381164-1002\SOFTWARE\Feishu-cxmt



#定义基础信息
$Path="\\127.0.0.1\capture\"
$ComputerName = hostname
$collect_date =Get-Date -Format "yyyy-MM-dd HH_mm"
$DisPath= $Path+$ComputerName+"_HemsInfo.txt" 

#根据文件路径获取文件属性
function get_fileInfo 
{
   
    param($file_path="")
    $fileInfo = Get-Item $file_path


    $data_source="File"
    $file_Path=$file_path
    $file_DataDir="未知"
    $file_Version=$fileInfo.VersionInfo.ProductVersion
    $file_CreationTime=$fileInfo.CreationTime
    $Msg=$collect_date+":"+$ComputerName+"|" +$data_source+"|" +$file_Path+"|" +$file_DataDir+"|" +$file_Version+"|" +$file_CreationTime


    #Write-Host  $Msg
    Write-Output $Msg|Out-File -filepath $DisPath -Append
                
        }

#测试用例
#get_fileInfo "C:\HEMS English Version\app\HEMS English Version.exe"


#根据注册表信息获取文件Hems 属性

function get_reginfo
{
    param($reg_path="")

    $reg_res=Get-ItemProperty -Path $reg_path

    $data_source="reg"
    $file_Path=$reg_res.InstallDir+"\"+$reg_res.ExeFileName
    $file_DataDir=$reg_res.DataDir
    $file_Version=$reg_res.Version
    $file_CreationTime="未知"
    $Msg=$collect_date+":"+$ComputerName+"|" +$data_source+"|" +$file_Path+"|" +$file_DataDir+"|" +$file_Version+"|" +$file_CreationTime


    #Write-Host  $Msg
    Write-Output $Msg|Out-File -filepath $DisPath -Append

}
#测试用例
#get_reginfo "Registry::HKEY_USERS\S-1-5-21-3354446880-2111472190-2361381164-1002\SOFTWARE\Feishu-cxmt"


#任务1:执行循环 获取注册表信息
foreach ($item in (Get-childItem -Path "Registry::HKEY_USERS\"))
    {

   # 仅取属于用户得注册表信息
    if ($item.Name.Length -eq 57)
        {

        #判断 注册表路径是否存在
        $reg_path= "Registry::HKEY_USERS\" +$item.PSChildName + "\SOFTWARE\Feishu-cxmt"
         if((Test-Path $reg_path))
                {
                 get_reginfo  $reg_path
                 }

        }
    }



#任务2:执行循环 获取文件路径信息
foreach ($item in (Get-childItem -Path "C:\Users\"))
    {

        #判断 注册表路径是否存在
        $file_path= "C:\Users\" +$item.Name + "\AppData\Local\HEMS English Version\app\HEMS English Version.exe"
         if((Test-Path $file_path))
                {
                 get_fileInfo  $file_path
                 }
        }

#任务3:查询 C 盘根目录下面文件
$Temporary_Path  = "C:\HEMS English Version\app\HEMS English Version.exe"
if((Test-Path  $Temporary_Path))
    {
        get_fileInfo  $Temporary_Path
        }

标签:English,Version,file,Path,软件,path,安装,reg,统计
From: https://www.cnblogs.com/vmsky/p/17388415.html

相关文章

  • FreeSWITCH安装教程
    最近学习freeswitch,网络上搜罗了大把的安装教程,基本都有坑。然而,对于解决坑的过程是坑坑有惊喜。在此记录一下安装及采坑的过程。如有问题,欢迎大家留言探讨~~~1、基础环境。操作系统:CentOSLinuxrelease7.9.2009位数:LinuxSSUAiServer3.10.0-1160.el7.x86_64#1SMPMo......
  • 老版本ubuntu16.04安装zabbix-agent
    最好用的agent应该是zabbix-agent2,不仅选项丰富,更是可以监控容器但是由于ubutu16.04版本太低,没有对应的zabbix-agent2,所以这里只能安装zabbix-agent安装步骤下载安装源在https://repo.zabbix.com/zabbix/找到对应版本的源这里以6.2.4版本的为例找到的地址就是https://rep......
  • rocky linux:安装epel,解决部分包搜索不到(Rocky Linux 9.1)
    一,安装epel我们以libzip-devel为例:默认搜索不到[root@img~]#yumsearchlibzip-develLastmetadataexpirationcheck:0:02:34agoonWed10May202301:15:06PMCST.Nomatchesfound.使crb为可用状态[root@img~]#dnfconfig-manager--set-enabledcrb安装epel......
  • Windows下安装Redis,并设置开机自动启动
    这篇文章是在Windows上安装redis,关于如何在Linux上安装redis可以参看Redis下载地址:https://github.com/tporadowski/redis/releases1.下载redis,并解压2.打开cmd命令行进入redis文件夹下,输入如下命令redis-server.exeredis.windows.conf 3.打开一个新的cmd,输入命令redis-serve......
  • Linux CentOS7下安装Redis
    这篇文章是在Linux上安装redis,关于如何在window上安装redis可以参看1.下载Redis。进官网下载最新稳定版 https://redis.io/download2.使用工具上传到linux上,默认根目录root即可 3.解压redis,并把redis移到/usr/local目录下 tarxzfredis-6.0.9.tar.gz//解压mvredis-6.0.9......
  • 软件开机自动运行
    1.点击开始菜单->程序,找到“启动”,点键点它,选择“打开”。2.将需要启动和软件的快捷方式拖(或复制)到“启动”文件夹里即可。备注:如果你安装了360安全卫士的话,会弹出一个对话框提示你“一个未知的系统启动项正在被装入”,允许即可。......
  • app直播源代码,高仿软件评论底部弹出框
    app直播源代码,高仿软件评论底部弹出框这个弹窗的效果是使用BottomSheetDialogFragment做的,第一个弹出的对话框为CommentListDialogFragment,第二个弹出的对话框为SendCommentDialogFragment,代码如下: 展示CommentListDialogFragment。  publicclassCommentListDialogFra......
  • 如何使用C#自制一个Windows安装包
    C:\ProgramData\PackageCache\{E5715C32-34B0-6F8E-81B8-13FB19B1B682}v10.1.22000.832\Installers 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FBF034E1-563E-1F9D-DC45-491BB88E9B9E} 计算机\HKEY_LOCAL_MAC......
  • 安装ESXi遇到Relocating modules and starting up the kernel的处理
    原文https://blog.csdn.net/weixin_33857679/article/details/85666367https://blog.csdn.net/qq_54947566/article/details/123008779在一些Dell较旧的服务器上安装ESXi5.x时,会遇到卡在Relocatingmodulesandstartingupthekernel过不去的问题.比如我装的这台CS24VSS.......
  • 如何在Ubuntu 22.04上安装Linux 内核、更新内核以后出现:nas挂不上、nas挂载失败、moun
    按照如下链接安装Linux内核:如何在Ubuntu22.04上安装Linux内核6.0?,内核安装确实成功了,但是我在挂载nas的时候会出现如下错误:mounterror:cifsfilesystemnotsupportedbythesystemmounterror(19):NosuchdeviceRefertothemount.cifs(8)manualpage(e.g.manmoun......