띠옹이의 멤오장

  • 홈
  • 태그
  • 방명록

PowerShell 2

[PowerShell] 폴더 내 특정 확장자 파일명 리스트 저장하기

# 파일이 존재하는 폴더 경로를 사용자에게 입력받는다. [string]$Path = "" $Path = Read-Host "경로를 입력하세요" # 배열에 입력받은 폴더 경로를 \로 분할한다. $Array = $Path.Split("\") # 배열의 맨 마지막 폴더명으로 값을 할당한다. [string]$FileName = $Array[-1] # 해당 폴더 경로의 모든 파일명을 합쳐서 임시 텍스트파일에 저장한다. Get-ChildItem "$Path" -Recurse | %{$_.Name} > D:\test\A__list.txt # 위에서 생성한 텍스트 파일 중 (test).txt 문자열을 빈칸으로 치환한다. ('\' 는 와일드카드임) Get-Content D:\test\A__list.txt | %{$_ -..

PowerShell 2024.02.22

[PowerShell] port 번호로 서비스 헬스 체크 & 미기동시 서비스 시작

담당하는 장비의 nodeJS서비스가 간헐적으로 떨어지는 이슈가 발생하여 자동으로 서비스 시작 시키기 위해 아래 poweshell 스크립트 작성 후 작업 스케줄러에 등록하여 사용하고 있음 # 로깅 용 함수 선언 # https://www.sharepointdiary.com/2019/06/create-log-file-in-powershell-script.html Function Log-Message() { param ( [Parameter(Mandatory=$true)] [string] $Message ) Try { #Get the current date $LogDate = (Get-Date).tostring("yyyyMMdd") #Get the Location of the script If ($psise) ..

PowerShell 2024.02.19
이전
1
다음
더보기
프로필사진

띠옹이의 멤오장

MSSQL DBA

  • 분류 전체보기 (29)
    • MSSQL (22)
    • Mysql (1)
    • Python (2)
    • PowerShell (2)
    • 냥냥 (1)

Tag

uniquifier, 20.2, index, xp_dirtree, AWAITING COMMAND, 테이블값생성자, 연결보안, Python, 데이터베이스 스냅샷, error 666, sql_expression_dependencies, sp_depends, 문자열파싱, sp_who2, PoweShell, filelistonly, trustworthy, mssql, 유지관리계획, from values,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바